/* ═══════════════════════════════════════════════════════
   RAIL PLANNER — White mode, moderne & coloré
   Police : Inter (Google Fonts)
   ═══════════════════════════════════════════════════════ */

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

/* ── Variables ─────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg-page:        #f4f6fb;
  --bg-white:       #ffffff;
  --bg-subtle:      #f0f2f8;
  --bg-panel:       #ffffff;

  /* Bordures */
  --border-light:   #e4e8f0;
  --border-mid:     #c8d0e0;
  --border-strong:  #a0aec0;

  /* Textes */
  --text-primary:   #1a2035;
  --text-secondary: #4a5578;
  --text-muted:     #8492b0;
  --text-dim:       #b0bbcc;

  /* Accent heure PAIRE — violet/indigo */
  --even-500:       #6366f1;
  --even-400:       #818cf8;
  --even-100:       #e0e7ff;
  --even-50:        #eef2ff;

  /* Accent heure IMPAIRE — emeraude */
  --odd-500:        #10b981;
  --odd-400:        #34d399;
  --odd-100:        #d1fae5;
  --odd-50:         #ecfdf5;

  /* Danger / succès */
  --danger:         #ef4444;
  --danger-bg:      #fef2f2;
  --danger-border:  #fecaca;
  --success:        #10b981;

  /* Dimensions */
  --header-h:       64px;
  --controls-h:     38px;
  --row-h:          40px;
  --col-w:          52px;
  --label-w:        90px;
  --time-row-h:     36px;
  --total-slots:    24;

  /* Rayons */
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;

  /* Ombres */
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:      0 4px 16px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:      0 12px 40px rgba(0,0,0,.14), 0 4px 8px rgba(0,0,0,.06);
  --shadow-panel:   0 8px 32px rgba(99,102,241,.15), 0 2px 8px rgba(0,0,0,.08);

}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════ */
.app-header {
  height: var(--header-h);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left  { flex: 0 0 auto; }
.header-center { flex: 1; display: flex; justify-content: center; }
.header-right  { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 26px; }
.logo-text  { display: flex; flex-direction: column; }
.logo-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--even-500);
  line-height: 1.2;
}
.logo-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Légende */
.legend { display: flex; gap: 16px; align-items: center; }
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.legend-dot.even    { background: var(--even-500); }
.legend-dot.odd     { background: var(--odd-500); }
.legend-dot.blocked { background: var(--border-mid); }

/* ── Boutons ─────────────────────────────────────────── */
.btn-action {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-action:hover {
  border-color: var(--even-400);
  color: var(--even-500);
  background: var(--even-50);
}
.btn-action.btn-primary {
  background: var(--even-500);
  border-color: var(--even-500);
  color: #fff;
}
.btn-action.btn-primary:hover {
  background: #4f46e5;
  border-color: #4f46e5;
}
.btn-action.btn-danger {
  border-color: var(--danger-border);
  color: var(--danger);
  background: var(--danger-bg);
}
.btn-action.btn-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* ════════════════════════════════════════════════════════
   WEEK NAVIGATOR
   ════════════════════════════════════════════════════════ */
.week-navigator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 6px 10px;
}

.week-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 170px;
}
.week-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: .3px;
}
.week-dates {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .3px;
}

.btn-week-nav {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  transition: all .15s;
  line-height: 1;
  padding-bottom: 1px;
}
.btn-week-nav:hover {
  background: var(--even-500);
  border-color: var(--even-500);
  color: #fff;
}

.btn-today {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  background: var(--bg-white);
  border-color: var(--border-mid);
  color: var(--text-muted);
}
.btn-today:hover {
  border-color: var(--even-400);
  color: var(--even-500);
  background: var(--even-50);
}

/* ════════════════════════════════════════════════════════
   CONTROLS BAR
   ════════════════════════════════════════════════════════ */
.controls-bar {
  height: var(--controls-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.status-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.stats-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--even-500);
  background: var(--even-50);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--even-100);
}

/* ════════════════════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════════════════════ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.grid-scroll-wrapper {
  flex: 1;
  overflow: auto;
  padding: 20px;
  scrollbar-width: auto;
  scrollbar-color: var(--border-mid) transparent;
}
.grid-scroll-wrapper::-webkit-scrollbar       { height: 8px; width: 8px; }
.grid-scroll-wrapper::-webkit-scrollbar-track { background: #f0f0f0; }
.grid-scroll-wrapper::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 4px; box-shadow: inset 0 0 3px rgba(0,0,0,.2);}
.grid-scroll-wrapper::-webkit-scrollbar-thumb:hover,
.grid-scroll-wrapper::-webkit-scrollbar-thumb:active {
  background: lighten(var(--border-mid), 10%);   /* or use a custom color */
}

/* ════════════════════════════════════════════════════════
   BLOCS DE RÉSERVATION
   ════════════════════════════════════════════════════════ */
.reservation-block {
  position: absolute;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 5px 10px 5px 12px;
  cursor: grab;
  user-select: none;
  z-index: 5;
  overflow: hidden;
  transition: transform .12s, box-shadow .12s;
}
.reservation-block:hover {
  transform: translateY(-1px) scale(1.005);
  z-index: 6;
}
.reservation-block.dragging {
  opacity: .85;
  cursor: grabbing;
  z-index: 50;
  transform: scale(1.03) rotate(-0.5deg);
}

/* Départ heure PAIRE — indigo/violet */
.reservation-block.even-dep {
  background: var(--even-500);
  border-left: 4px solid #4338ca;
  color: #fff;
  box-shadow: 0 2px 10px rgba(99,102,241,.35), 0 1px 3px rgba(0,0,0,.1);
}
.reservation-block.even-dep:hover {
  box-shadow: 0 6px 20px rgba(99,102,241,.45), 0 2px 6px rgba(0,0,0,.12);
}

/* Départ heure IMPAIRE — émeraude */
.reservation-block.odd-dep {
  background: var(--odd-500);
  border-left: 4px solid #059669;
  color: #fff;
  box-shadow: 0 2px 10px rgba(16,185,129,.35), 0 1px 3px rgba(0,0,0,.1);
}
.reservation-block.odd-dep:hover {
  box-shadow: 0 6px 20px rgba(16,185,129,.45), 0 2px 6px rgba(0,0,0,.12);
}

/* Petits ronds décoratifs (roues) */
.reservation-block::before,
.reservation-block::after {
  content: '';
  position: absolute;
  bottom: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  border: 1.5px solid rgba(255,255,255,.5);
}
.reservation-block::before { left: 10px; }
.reservation-block::after  { right: 8px; }

.block-name {
  font-size: 11px;
  font-weight: 700;
  /* white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; */
  max-width: 100%;
  line-height: 1.3;
  color: #fff;
  word-wrap: break-word;
}
.block-meta {
  font-size: 9px;
  font-weight: 500;
  opacity: .8;
  white-space: nowrap;
  color: rgba(255,255,255,.9);
  margin-top: 1px;
}

/* .block-delete {
  position: absolute;
  top: 4px;
  right: 5px;
  background: rgba(255,255,255,.2);
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 9px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
  color: rgba(255,255,255,.9);
  display: none;
  z-index: 2;
  transition: background .12s;
} */
.reservation-block:hover .block-delete { display: block; }
/* .block-delete:hover { background: rgba(239,68,68,.8); } */

/* ════════════════════════════════════════════════════════
   PANNEAU DE RÉSERVATION
   ════════════════════════════════════════════════════════ */
.booking-panel {
  position: fixed;
  right: 20px;
  top: calc(var(--header-h) + 20px);
  width: 320px;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  z-index: 200;
  box-shadow: var(--shadow-panel);
  max-height: 80vh;
  overflow-y: auto; 
  transform: translateX(0);
  transition: transform .22s cubic-bezier(.4,0,.2,1), opacity .22s;
}
.booking-panel.hidden {
  transform: translateX(360px);
  opacity: 0;
  pointer-events: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--even-50);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.panel-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--even-500);
  letter-spacing: .3px;
}
.panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}
.panel-close:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.field-group input[type="number"],
.field-group input[type="text"] {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color .15s, background .15s;
}
.field-group input:focus {
  border-color: var(--even-500);
  background: var(--bg-white);
  box-shadow: 0 0 0 3px var(--even-100);
}

.panel-info {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  color: var(--text-primary);
}
.panel-info.muted { color: var(--text-dim); }

.panel-error {
  font-size: 12px;
  font-weight: 500;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.panel-error.hidden { display: none; }

.panel-actions { display: flex; gap: 8px; margin-top: 4px; }
.panel-actions .btn-action { flex: 1; text-align: center; justify-content: center; }

.panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
}
.panel-overlay.hidden { display: none; }

/* ════════════════════════════════════════════════════════
   TOOLTIP
   ════════════════════════════════════════════════════════ */
.tooltip {
  position: fixed;
  background: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  pointer-events: none;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  max-width: 230px;
  line-height: 1.7;
}
.tooltip.hidden { display: none; }

/* ════════════════════════════════════════════════════════
   EXPORT MODAL
   ════════════════════════════════════════════════════════ */
.export-modal {
  position: fixed;
  inset: 0;
  background: rgba(26,32,53,.45);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}
.export-modal.hidden { display: none; }

.export-modal-inner {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}
.export-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.export-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

#export-content {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  overflow: auto;
  flex: 1;
  line-height: 1.8;
  white-space: pre;
}

/* ════════════════════════════════════════════════════════
   INDICATEUR DE CHARGEMENT
   ════════════════════════════════════════════════════════ */
.grid-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--even-500);
  letter-spacing: .5px;
  z-index: 40;
  pointer-events: none;
}
.grid-loading.hidden { display: none; }

/* ════════════════════════════════════════════════════════
   UTILITAIRES
   ════════════════════════════════════════════════════════ */
.hidden { display: none !important; }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}

/* ═══════════════════════════════════════════════════════
   ONGLETS JOURS
   ═══════════════════════════════════════════════════════ */
 
.day-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
}
 
.day-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 10px;
  border: 1.5px solid #e4e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Inter', sans-serif;
  min-width: 50px;
}
.day-tab:hover {
  border-color: #6366f1;
  background: #eef2ff;
}
.day-tab.active {
  background: #6366f1;
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.day-tab.today:not(.active) {
  border-color: #10b981;
  background: #ecfdf5;
}
.day-tab-name {
  font-size: 11px;
  font-weight: 700;
  color: #4a5578;
  letter-spacing: .3px;
}
.day-tab.active .day-tab-name,
.day-tab.active .day-tab-date { color: #fff; }
.day-tab.today:not(.active) .day-tab-name,
.day-tab.today:not(.active) .day-tab-date { color: #059669; }
.day-tab-date {
  font-size: 10px;
  font-weight: 500;
  color: #8492b0;
}
 
/* Controls bar avec onglets */
.controls-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #e4e8f0;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.controls-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
 
/* ═══════════════════════════════════════════════════════
   MODULES ÉLECTRIQUES — sélecteur dans le panneau
   ═══════════════════════════════════════════════════════ */
 
.elec-module-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
 
.elec-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.elec-input-row input {
  width: 70px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 10px;
  background: #f4f6fb;
  border: 1.5px solid #e4e8f0;
  border-radius: 8px;
  color: #1a2035;
  outline: none;
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.elec-input-row input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px #e0e7ff;
  background: #fff;
}
.elec-unit {
  font-size: 12px;
  font-weight: 500;
  color: #8492b0;
}
 
/* Barre de disponibilité */
.elec-bar-wrap {
  height: 6px;
  background: #f0f2f8;
  border-radius: 99px;
  overflow: hidden;
}
.elec-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: #10b981;
  transition: width .3s ease, background .3s;
  width: 0%;
}
 
.elec-available {
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
}
 
 
/* ═══════════════════════════════════════════════════════
   MISE À JOUR : planning page — controls-bar
   ═══════════════════════════════════════════════════════ */
 
/* Supprimer l'ancien controls-bar s'il existait en double */
.page-planning .controls-bar {
  height: auto;
  min-height: 52px;
}
 
/* ═══════════════════════════════════════════════════════
   DAY NAVIGATOR (remplace les onglets jours)
   ═══════════════════════════════════════════════════════ */
 
.day-navigator {
  display: flex;
  align-items: center;
  gap: 4px;
}
 
/* Boutons «« ‹ › »» — taille différenciée */
.day-navigator .btn-week-nav {
  width: 30px;
  height: 30px;
  border: 1.5px solid #e4e8f0;
  border-radius: 7px;
  background: #fff;
  color: #4a5578;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .14s;
  padding: 0;
  line-height: 1;
}
.day-navigator .btn-week-nav:hover {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}
 
/* Boutons semaine (« ») légèrement plus petits visuellement */
#btn-prev-week,
#btn-next-week {
  font-size: 14px;
  color: #8492b0;
}
#btn-prev-week:hover,
#btn-next-week:hover {
  color: #fff;
}
 
/* Affichage jour */
.day-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 190px;
  padding: 0 8px;
}
 
/* week-label et week-dates réutilisés */
.day-navigator .week-label { font-size: 13px; font-weight: 700; color: #1a2035; line-height: 1.2; letter-spacing: .2px; }
.day-navigator .week-dates { font-size: 11px; font-weight: 600; color: #6366f1; letter-spacing: .3px; }

/* ═══════════════════════════════════════════════════════
   SECTION TARIF (panneau latéral)
   ═══════════════════════════════════════════════════════ */

.pricing-section {
  border-top: 0.5px solid #e4e8f0;
  margin-top: 4px;
  padding-top: 4px;
}

.pricing-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f4f6fb;
  border: 1.5px solid #e4e8f0;
  border-radius: 8px;
  padding: 9px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #4a5578;
  cursor: pointer;
  transition: all .14s;
  letter-spacing: .3px;
}
.pricing-toggle:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #6366f1;
}

#pricing-toggle-icon {
  font-size: 10px;
  color: #8492b0;
}

.pricing-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
}

/* champs tarif dans la grid 2 colonnes (field-row déjà défini) */
.pricing-body .field-group input {
  width: 100%;
}

.btn-calculate {
  width: 100%;
  text-align: center;
  background: #f4f6fb;
  border-color: #c8d0e0;
  color: #4a5578;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  padding: 8px;
  border-radius: 8px;
  transition: all .14s;
}
.btn-calculate:hover {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}
.btn-calculate:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Résultat du calcul */
.price-result {
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.price-result.ok {
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
}
.price-result.error {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
}

.price-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.price-result-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.price-result-val {
  font-size: 14px;
  font-weight: 600;
  color: #059669;
}
.price-result.error .price-result-val {
  color: #dc2626;
}
.price-result-big {
  font-size: 20px;
  font-weight: 700;
}
.price-result-error {
  font-size: 12px;
  color: #dc2626;
  font-weight: 500;
  line-height: 1.4;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════
   STATUTS DE RÉSERVATION
   ═══════════════════════════════════════════════════════ */
 
/* Overlay visuel sur le bloc selon le statut */
.reservation-block.status-pending   { opacity: .80; }
.reservation-block.status-cancelled {
  opacity: .45;
  filter: grayscale(.6);
  border-left-color: #9ca3af !important;
}
.reservation-block.status-completed {
  opacity: .65;
  filter: grayscale(.3);
}
.reservation-block.status-paid      { opacity: 1; }  /* défaut, rien à faire */
 
/* Badge statut sur le bloc */
.block-status-badge {
  position: absolute;
  bottom: 6px;
  left: 10px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  letter-spacing: .3px;
  pointer-events: none;
  white-space: nowrap;
}
.status-badge-pending   { background: rgba(251,191,36,.25);    color: #fff; border: 1px solid rgba(251,191,36,.5); }
.status-badge-cancelled { background: rgba(239,68,68,.25);     color: #fff; border: 1px solid rgba(239,68,68,.5); }
.status-badge-completed { background: rgba(107,114,128,.3);    color: #fff; border: 1px solid rgba(107,114,128,.5); }
.status-badge-paid      { background: rgba(255,105,180,.25);   color: #fff; border: 1px solid rgba(255,105,180,.5); }
.status-badge-admin     { background: rgba(48, 213, 200, .25); color: #fff; border: 1px solid rgba(48, 213, 200, .5); }

/* Sélecteur statut dans le panneau */
.payment-select,
.status-select {
  width: 100%;
  padding: 8px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: #f4f6fb;
  border: 1.5px solid #e4e8f0;
  border-radius: 8px;
  color: #1a2035;
  outline: none;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238492b0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.status-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px #e0e7ff;
  background-color: #fff;
}
 
/* Couleurs selon valeur sélectionnée */
.status-select option[value="pending"]   { color: #92400e; }
.status-select option[value="paid"]      { color: #065f46; }
.status-select option[value="cancelled"] { color: #991b1b; }
.status-select option[value="completed"] { color: #374151; }

/* ═══════════════════════════════════════════════════════
   MINI CALENDRIER MODAL
   ═══════════════════════════════════════════════════════ */
 
/* Bouton déclencheur dans la nav */
.btn-calendar-toggle {
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .14s, border-color .14s;
}
.btn-calendar-toggle:hover {
  background: #eef2ff;
  border-color: #6366f1;
}
 
/* Overlay */
.calendar-overlay {
  position: fixed;
  inset: 0;
  z-index: 149;
  background: rgba(26, 32, 53, .25);
  backdrop-filter: blur(2px);
}
.calendar-overlay.hidden { display: none; }
 
/* Modal */
.calendar-modal {
  position: fixed;
  z-index: 150;
  /* Positionné sous la nav, aligné à gauche du bouton calendrier */
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1.5px solid #e4e8f0;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .14), 0 2px 8px rgba(99,102,241,.10);
  padding: 16px;
  width: 280px;
  animation: cal-pop .15s cubic-bezier(.4,0,.2,1);
}
.calendar-modal.hidden { display: none; }
 
@keyframes cal-pop {
  from { opacity: 0; transform: translateX(-50%) scale(.95) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) scale(1)   translateY(0); }
}
 
/* En-tête du calendrier */
.calendar-modal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.cal-month-label {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #1a2035;
  letter-spacing: .2px;
}
.cal-nav-btn {
  width: 28px;
  height: 28px;
  border: 1.5px solid #e4e8f0;
  border-radius: 7px;
  background: #fff;
  color: #4a5578;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all .12s;
  padding-bottom: 1px;
}
.cal-nav-btn:hover {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}
.cal-close-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: #8492b0;
  font-size: 14px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
  margin-left: 2px;
}
.cal-close-btn:hover { background: #f0f2f8; color: #1a2035; }
 
/* Jours de la semaine */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #8492b0;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 0;
}
 
/* Grille des jours */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
 
.cal-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: #1a2035;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s, color .1s;
  font-family: 'Inter', sans-serif;
  padding: 0;
}
.cal-day:hover {
  background: #eef2ff;
  color: #6366f1;
}
.cal-day-empty {
  cursor: default;
  pointer-events: none;
}
 
/* Aujourd'hui */
.cal-day.cal-today {
  background: #eef2ff;
  color: #6366f1;
  font-weight: 700;
  border: 1.5px solid #c7d2fe;
}
.cal-day.cal-today:hover { background: #e0e7ff; }
 
/* Jour sélectionné (currentDate) */
.cal-day.cal-current {
  background: #6366f1;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(99,102,241,.35);
}
.cal-day.cal-current:hover { background: #4f46e5; }
 
/* Si aujourd'hui ET sélectionné */
.cal-day.cal-today.cal-current {
  background: #6366f1;
  border-color: #4f46e5;
  color: #fff;
}
 
/* Jours passés */
.cal-day.cal-past {
  color: #c8d0e0;
}
.cal-day.cal-past:hover {
  background: #f4f6fb;
  color: #8492b0;
}

/* ── Sélecteur de déplacement ───────────────────── */
.move-selector {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.move-selector input[type="date"],
.move-selector select {
  flex: 1;
  min-width: 120px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
}

.btn-move {
  background: #8b5cf6;
  color: white;
  white-space: nowrap;
}
.btn-move:hover { background: #7c3aed; }

/* ── Toast de confirmation ──────────────────────── */
.move-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #1e1e2e;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  font-size: 0.9rem;
  z-index: 9999;
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.move-toast button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
}

#toast-go {
  color: #818cf8;
  font-weight: 600;
  text-decoration: underline;
}

#toast-close { color: #6b7280; }

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  max-width: 50%;
  width: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateX(110%);
  transition: opacity .3s ease, transform .3s ease;
}

.toast.success { background-color: #2e7d32; }
.toast.error   { background-color: #c62828; }

.toast.show { transform: translateY(0); opacity: 1; }
.toast-emoji { font-size: 18px; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════
   CONFIRMATION MODAL
   ═══════════════════════════════════════════════════════ */

/* ------------------------------------------------------------------
   Overlay global – couvre tout l’écran
------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;                     /* top/right/bottom/left = 0 */
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;                /* au-dessus de tout le contenu */
}

/* Cache l’overlay quand on n’en a pas besoin */
.modal-overlay.hidden {
    display: none;
}

/* ------------------------------------------------------------------
   Boîte du modal – centre, fond blanc, arrondi
------------------------------------------------------------------- */
.modal-box {
    background: #fff;
    padding: 1.5rem;
    border-radius: .6rem;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* ------------------------------------------------------------------
   Boutons d’action
------------------------------------------------------------------- */
.btn {
    padding: .5rem 1rem;
    border: none;
    border-radius: .3rem;
    cursor: pointer;
    font-size: 1rem;
}

.btn-danger {
    background-color: #d9534f; /* rouge */
    color: #fff;
}
.btn-secondary {
    background-color: #6c757d; /* gris */
    color: #fff;
}

/* Espacement entre les boutons */
.modal-actions button + button {
    margin-left: .5rem;
}

/* ════════════════════════════════════════════════════════
   CAHIER DE LIAISON
   ════════════════════════════════════════════════════════ */
/* ── Cahier de liaison ──────────────────────────── */
.daily-note-section {
  margin: 10px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.daily-note-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised, var(--surface));
}

.daily-note-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.daily-note-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.daily-note-status {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.daily-note-status.saving { color: var(--text-muted); }
.daily-note-status.saved  { color: #10b981; }
.daily-note-status.error  { color: #ef4444; }

.daily-note-textarea {
  width: 100%;
  min-height: 30px;
  padding: 5px 5px;
  border: none;
  resize: vertical;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
  outline: none;
}

.daily-note-textarea:focus {
  background: var(--surface-focus, var(--surface));
}

.daily-note-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Bouton commentaires sur le bloc ────────────── */
.block-actions {
  position: absolute;
  top: 5px;
  right: 10px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.15s;
  min-width: 100px;
  background: transparent;
  border-radius: 4px;
}
.reservation-block:hover .block-actions { opacity: 1; }

.block-btn {
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  padding: 10px 8px;
  line-height: 0.75;
  
  background: rgba(0,0,0,0.75);
}
.block-delete {
  font-variant-emoji: emoji;
  min-width: 37px;
  min-height: 37px;
}
.block-btn-comments:hover { background: #f8d510; }
.block-delete:hover       { background: #ef4444; }

/* ── Modal commentaires ─────────────────────────── */
.comments-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1100;
}
.comments-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 95vw);
  max-height: 80vh;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.comments-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.comments-modal-header h3 { margin: 0; font-size: 1rem; }
.comments-subtitle        { font-size: 0.8rem; color: var(--text-muted); }

/* Onglets */
.comments-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.comments-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.comments-tab.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
  font-weight: 600;
}
.tab-badge {
  display: inline-block;
  background: #6366f1;
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0 6px;
  margin-left: 4px;
  min-width: 16px;
  text-align: center;
}

/* Panneaux */
.comments-tab-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Liste commentaires */
.comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  max-height: 280px;
}
.comments-loading,
.comments-empty,
.comments-error { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 24px; }
.comments-error { color: #ef4444; }

.comment-item {
  background: var(--surface-raised, #f9f9f9);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
}
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.comment-author { font-weight: 600; color: var(--text); }
.comment-date   { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }
.comment-delete {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.8rem; padding: 0 2px;
}
.comment-delete:hover { color: #ef4444; }
.comment-content { color: var(--text); white-space: pre-wrap; line-height: 1.5; }

/* Formulaire commentaire */
.comment-form {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.comment-form textarea {
  flex: 1;
  resize: none;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--bg-page);
  color: var(--text);
}

/* Liste pièces jointes */
.attachments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  max-height: 280px;
}
.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-raised, #f9f9f9);
  border-radius: 8px;
  font-size: 0.85rem;
}
.attachment-icon { font-size: 1.4rem; flex-shrink: 0; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name {
  display: block;
  color: #6366f1;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.attachment-name:hover { text-decoration: underline; }
.attachment-meta { font-size: 0.75rem; color: var(--text-muted); }
.attachment-delete {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); flex-shrink: 0;
}
.attachment-delete:hover { color: #ef4444; }

/* Upload */
.attachment-form {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.attachment-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 2px dashed var(--border-mid);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}
.attachment-upload-label:hover { border-color: #6366f1; color: #6366f1; }
.attachment-upload-label input { display: none; }

.attachment-upload-status {
  font-size: 0.8rem;
  margin-top: 6px;
  text-align: center;
  min-height: 18px;
}
.attachment-upload-status.uploading { color: var(--text-muted); }
.attachment-upload-status.success   { color: #10b981; }
.attachment-upload-status.error     { color: #ef4444; }