:root {
--bg: #F7F6F3;
--surface: #FFFFFF;
--border: #E8E5DF;
--text: #1A1917;
--text-muted: #8C8880;
--accent: #D4611A;
--accent-light: #FDF0E8;
--accent-dark: #B5500F;
--green: #2D7A4F;
--green-light: #EAF4EE;
--red: #C0392B;
--red-light: #FDECEA;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
font-family: 'DM Sans', sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
display: flex;
}

/* ── SIDEBAR ── */
.sidebar {
width: 220px;
background: var(--surface);
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
padding: 28px 0;
position: fixed;
height: 100vh;
}

.logo {
padding: 0 24px 32px;
border-bottom: 1px solid var(--border);
}

.logo-text { font-size: 18px; font-weight: 600; letter-spacing: -0.5px; }
.logo-sub  { font-size: 11px; color: var(--text-muted); margin-top: 2px; letter-spacing: 0.5px; text-transform: uppercase; }

.nav { padding: 20px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }

.nav-item {
display: flex; align-items: center; gap: 10px;
padding: 10px 12px; border-radius: 8px; cursor: pointer;
font-size: 14px; font-weight: 400; color: var(--text-muted);
transition: all 0.15s; text-decoration: none;
}
.nav-item:hover  { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.nav-section {
font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
color: var(--text-muted); padding: 16px 12px 6px; font-weight: 500;
}

.sidebar-bottom {
  padding: 20px 12px;
  border-top: 1px solid var(--border);
  position: relative;
}

.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }

.avatar {
width: 32px; height: 32px; background: var(--accent); border-radius: 50%;
display: flex; align-items: center; justify-content: center;
color: white; font-size: 13px; font-weight: 600; flex-shrink: 0;
}

.avatar-md {
width: 40px; height: 40px; font-size: 14px;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ── MAIN ── */
.main {
margin-left: 220px;
flex: 1;
padding: 40px 48px;
max-width: calc(100vw - 220px);
}

.page-header { margin-bottom: 32px; }
.page-title  { font-size: 26px; font-weight: 600; letter-spacing: -0.5px; }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.page-header-row {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 16px;
margin-bottom: 24px;
}

/* ── BOUTONS ── */
.btn-primary {
background: var(--accent); color: white;
padding: 10px 20px; border-radius: 8px;
font-size: 13px; font-weight: 600;
border: none; cursor: pointer;
font-family: 'DM Sans', sans-serif;
white-space: nowrap; transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
background: transparent; color: var(--text-muted);
padding: 10px 20px; border-radius: 8px;
font-size: 13px; font-weight: 500;
border: 1px solid var(--border); cursor: pointer;
font-family: 'DM Sans', sans-serif;
transition: all 0.15s;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-white {
background: white; color: var(--text);
padding: 10px 22px; border-radius: 8px;
font-size: 13px; font-weight: 600;
border: none; cursor: pointer;
font-family: 'DM Sans', sans-serif;
white-space: nowrap; transition: opacity 0.15s;
display: flex; align-items: center; gap: 6px;
}
.btn-white:hover { opacity: 0.9; }

.icon-btn {
width: 32px; height: 32px; border-radius: 6px;
border: 1px solid transparent; background: transparent;
display: flex; align-items: center; justify-content: center;
cursor: pointer; font-size: 14px; color: var(--text-muted);
transition: all 0.15s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); border-color: var(--border); }

/* ── GENERATE CTA (dashboard) ── */
.generate-card {
background: var(--text);
color: white;
border-radius: 12px;
padding: 22px 28px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 20px;
margin-bottom: 28px;
}

.generate-left { display: flex; align-items: center; gap: 16px; }

.generate-icon {
font-size: 22px;
width: 44px; height: 44px;
background: rgba(255,255,255,0.1);
border-radius: 10px;
display: flex; align-items: center; justify-content: center;
flex-shrink: 0;
}

.generate-title { font-size: 15px; font-weight: 600; }
.generate-sub   { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 3px; }

.generate-right { display: flex; align-items: center; gap: 16px; }

.week-selector {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 13px; color: rgba(255,255,255,0.8);
  font-family: 'DM Sans', sans-serif;
}

.week-selector-text {
  padding: 0 8px;
  user-select: none;
  width: 220px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.week-nav-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px; line-height: 1;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.week-nav-btn:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}

/* Largeur fixe du bouton : évite que sa variation de texte décale le sélecteur */
#btn-generate {
  width: 220px;
  justify-content: center;
}

/* Empêche la zone de droite de se faire compresser par un texte long à gauche */
.generate-right {
  flex-shrink: 0;
}

/* ── LAYOUT ── */
.content-row {
display: grid;
grid-template-columns: 1fr 280px;
gap: 20px;
align-items: start;
}

/* ── CARD générique ── */
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 24px;
}

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

.card-title { font-size: 15px; font-weight: 600; }

/* ── CALENDRIER (dashboard) ── */
.month-nav { display: flex; align-items: center; gap: 12px; }

.month-nav-btn {
width: 28px; height: 28px; border-radius: 6px;
border: 1px solid var(--border); background: var(--surface);
display: flex; align-items: center; justify-content: center;
cursor: pointer; font-size: 13px; color: var(--text-muted);
transition: all 0.15s;
}
.month-nav-btn:hover { background: var(--bg); color: var(--text); }

.month-label { font-size: 14px; font-weight: 600; min-width: 120px; text-align: center; }

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

.cal-day-header {
text-align: center;
font-size: 11px;
font-weight: 600;
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.5px;
padding: 6px 0 10px;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
  padding: 4px 2px;
  min-height: 40px;
}

.cal-day.other-month { opacity: 0.3; }

.cal-day.today .day-num {
background: var(--accent);
color: white;
border-radius: 50%;
width: 24px; height: 24px;
display: flex; align-items: center; justify-content: center;
}


.day-num {
  font-size: 13px;
  font-weight: 500;
  font-family: 'DM Mono', monospace;
  line-height: 1;
}

.week-status-bar { height: 3px; border-radius: 2px; width: 70%; }
.status-generated { background: var(--green); }
.status-partial   { background: #F4C842; }
.status-none      { background: var(--border); }

/* Calendrier — 3 statuts */
/* Calendrier — 5 statuts */
.cal-day.week-attente_dispo        { background: var(--surface); }
.cal-day.week-attente_generation   { background: #FFD9D9; }
.cal-day.week-attente_envoi        { background: #FFE4B5; }
.cal-day.week-attente_sauvegarde   { background: #FEFBCC; }
.cal-day.week-sauvegardee          { background: #D4EDDA; }

.cal-legend {
display: flex; gap: 20px; margin-top: 20px;
padding-top: 16px; border-top: 1px solid var(--border);
}

.legend-item {
display: flex; align-items: center; gap: 6px;
font-size: 11px; color: var(--text-muted);
}

.legend-dot { width: 10px; height: 10px; border-radius: 50%; }

/* ── PANNEAU DROIT (dashboard) ── */
.right-panel { display: flex; flex-direction: column; gap: 16px; }

.alert {
display: flex; align-items: flex-start; gap: 10px;
padding: 12px 14px; border-radius: 8px;
font-size: 12.5px; line-height: 1.5;
margin-bottom: 8px;
}
.alert:last-child { margin-bottom: 0; }
.alert-warning { background: var(--accent-light); color: #7A3810; }
.alert-ok      { background: var(--green-light);  color: #1A5E36; }
.alert-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

.month-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary-stat {
background: var(--bg);
border-radius: 8px;
padding: 14px;
text-align: center;
}
.summary-val  { font-size: 22px; font-weight: 600; font-family: 'DM Mono', monospace; letter-spacing: -0.5px; }
.summary-lbl  { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.summary-val.green  { color: var(--green); }
.summary-val.orange { color: var(--accent); }

/* ── FILTRES (page employés) ── */
.filter-bar {
display: flex;
align-items: center;
gap: 16px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 10px;
padding: 12px 16px;
margin-bottom: 16px;
}

.search-input {
flex: 1;
border: none;
background: transparent;
font-family: 'DM Sans', sans-serif;
font-size: 14px;
color: var(--text);
outline: none;
}
.search-input::placeholder { color: var(--text-muted); }

.checkbox-inline {
display: flex;
align-items: center;
gap: 8px;
font-size: 13px;
color: var(--text-muted);
cursor: pointer;
white-space: nowrap;
}

/* ── LISTE EMPLOYÉS ── */
.employee-list {
display: flex;
flex-direction: column;
gap: 8px;
}

.employee-card {
display: flex;
align-items: center;
gap: 14px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 10px;
padding: 14px 18px;
transition: border-color 0.15s;
}
.employee-card:hover { border-color: #D4D0C8; }
.employee-card.inactive { opacity: 0.55; }

.employee-info { flex: 1; min-width: 0; }

.employee-name {
font-size: 14px;
font-weight: 500;
display: flex;
align-items: center;
gap: 8px;
}

.employee-meta {
font-size: 12px;
color: var(--text-muted);
margin-top: 2px;
}

.meta-sep { margin: 0 4px; opacity: 0.5; }

.employee-actions {
display: flex;
gap: 4px;
}

.badge-inactive {
font-size: 10px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
background: var(--border);
color: var(--text-muted);
padding: 2px 8px;
border-radius: 4px;
}

.empty-state {
text-align: center;
padding: 60px 20px;
color: var(--text-muted);
font-size: 14px;
background: var(--surface);
border: 1px dashed var(--border);
border-radius: 10px;
}

/* ── MODALE ── */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(26, 25, 23, 0.5);
display: none;
align-items: center;
justify-content: center;
z-index: 1000;
padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
background: var(--surface);
border-radius: 12px;
padding: 28px;
width: 100%;
max-width: 480px;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

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

.modal-title {
font-size: 18px;
font-weight: 600;
letter-spacing: -0.3px;
}

/* Scoping : ces styles ne s'appliquent qu'à la croix × du header,
   pas au bouton "Annuler" du footer (qui partage la classe pour le handler JS) */
.modal-header .modal-close {
width: 28px; height: 28px;
border: none;
background: transparent;
font-size: 22px;
cursor: pointer;
color: var(--text-muted);
display: flex; align-items: center; justify-content: center;
border-radius: 6px;
transition: all 0.15s;
}
.modal-header .modal-close:hover { background: var(--bg); color: var(--text); }

.modal-footer {
display: flex;
justify-content: flex-end;
gap: 10px;
margin-top: 28px;
padding-top: 20px;
border-top: 1px solid var(--border);
}

/* ── FORMULAIRE ── */
.form-group {
margin-bottom: 16px;
display: flex;
flex-direction: column;
gap: 6px;
flex: 1;
}

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

.form-divider {
height: 1px;
background: var(--border);
margin: 8px 0 20px;
}

.form-group label {
font-size: 12px;
font-weight: 500;
color: var(--text-muted);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="time"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
  outline: none;
  width: 100%;
}

.form-group input[type="number"] {
font-family: 'DM Mono', monospace;
}

.form-group input:focus {
border-color: var(--accent);
}

.checkbox-label {
display: flex !important;
flex-direction: row !important;
align-items: center;
gap: 10px;
cursor: pointer;
font-size: 13px !important;
color: var(--text) !important;
font-weight: 400 !important;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── ONGLETS (page cuisines) ── */
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 12px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tab.tab-add {
  color: var(--text-muted);
  font-weight: 400;
}

/* ── ÉDITEUR DE CUISINE ── */
.cuisine-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.cuisine-editor-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.cuisine-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
}

/* Grille 8 colonnes : 1 label + 7 jours */
.cuisine-grid {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.grid-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 0;
}

.grid-shift-label {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-right: 8px;
}

.grid-cell {
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 80px;
  transition: all 0.15s;
}
.grid-cell:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.grid-cell.ferme {
  background: transparent;
  border: 1px dashed var(--border);
}
.grid-cell.ferme:hover {
  background: var(--bg);
  border-color: var(--text-muted);
  border-style: dashed;
}

.cell-time {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.cell-time-sep {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 0.8;
}

.cell-besoin {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 4px;
  background: white;
  padding: 2px 8px;
  border-radius: 10px;
}

.cell-status {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin: auto;
}

/* Barre d'actions sous la grille */
.cuisine-actions-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.copy-warning {
  font-size: 11px;
  color: var(--text-muted);
}

/* Colorpicker plus large dans la modale cuisine */
.form-group input[type="color"] {
  width: 60px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
  background: var(--surface);
}

/* ── DASHBOARD : améliorations sélecteur + calendrier interactif ── */

/* Sélecteur de semaine : style enrichi avec séparateur */
.week-selector-label {
  font-weight: 500;
  color: white;
}

.week-selector-sep {
  opacity: 0.4;
  margin: 0 4px;
}

/* Cellule de calendrier cliquable */
.cal-day {
  cursor: pointer;
  transition: all 0.15s;
}
.cal-day:hover:not(.other-month) {
  transform: scale(1.05);
}

/* Semaine sélectionnée : highlight orange */
.cal-day.week-selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Bouton désactivé */
.btn-white:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* État vide compact (panneau alertes) */
.empty-state-inline {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

/* ── PAGE DISPONIBILITÉS ── */

.dispos-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.toolbar-field label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toolbar-field select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.toolbar-field select:focus { border-color: var(--accent); }

.toolbar-status {
  margin-left: auto;
  align-self: center;
}

.status-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
}
.status-pill-warning {
  background: var(--accent-light);
  color: #7A3810;
}
.status-pill-ok {
  background: var(--green-light);
  color: #1A5E36;
}

/* Liste des cartes-jour */
.dispos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.dispo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}

.dispo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.dispo-card-title {
  font-size: 14px;
  font-weight: 500;
  text-transform: capitalize;
}

.btn-small {
  padding: 6px 12px !important;
  font-size: 12px !important;
}

/* Plages horaires */
.dispo-plages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dispo-plage {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
}
.time-input:focus { border-color: var(--accent); }

.time-sep {
  color: var(--text-muted);
  font-size: 14px;
}

.dispo-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  padding: 4px 0;
}

.dispo-coverage {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Footer */
.dispos-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  position: sticky;
  bottom: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.dispos-footer-info {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-primary:disabled {
  cursor: not-allowed;
}

/* ── PAGE PLANNING ── */

.planning-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-self: center;
}

/* Toggle segmenté */
.view-toggle {
  display: flex;
  width: fit-content;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.toggle-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.toggle-btn:hover { color: var(--text); }
.toggle-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Grille du planning (2 layouts différents selon la vue) */
.planning-content { margin-bottom: 20px; }

.planning-grid {
  display: grid;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.planning-grid.view-employees {
  /* Employé (large) + 7 jours + Total */
  grid-template-columns: 180px repeat(7, 1fr) 80px;
}

.planning-grid.view-shifts {
  /* Shift (étroit) + 7 jours */
  grid-template-columns: 80px repeat(7, 1fr);
}

.grid-row-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 4px;
  display: flex;
  align-items: center;
}

/* Cellule employé (libellé de ligne en vue employés) */
.grid-emp-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 4px;
}
.grid-emp-name {
  font-size: 13px;
  font-weight: 500;
}
.grid-emp-contract {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
}

/* Libellé de shift en vue shifts */
.grid-shift-label-tall {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

/* Cellule de planning (vue employés) */
.planning-cell {
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 60px;
  align-items: center;
  justify-content: center;
}
.planning-cell.empty {
  background: transparent;
  border: 1px dashed var(--border);
}

.shift-pill {
  font-size: 11px;
  font-weight: 500;
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.planning-total {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border-radius: 8px;
}

.planning-total.over {
  background: var(--accent-light);
  color: var(--accent);
}

/* Cellule de planning (vue shifts) */
.planning-cell-shift {
  background: var(--bg);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 80px;
}
.planning-cell-shift.ferme {
  background: transparent;
  border: 1px dashed var(--border);
  align-items: center;
  justify-content: center;
}

.cell-shift-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.cell-shift-header.understaffed { color: var(--red); }

.cell-shift-time::after {
  content: '✎';
  font-size: 9px;
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.cell-shift-time:hover::after {
  opacity: 1;
}

.cell-shift-count {
  font-weight: 600;
  background: white;
  padding: 1px 6px;
  border-radius: 8px;
}
.cell-shift-header.understaffed .cell-shift-count {
  background: var(--red-light);
  color: var(--red);
}

.emp-tags {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.emp-tag {
  font-size: 11px;
  font-weight: 500;
  background: white;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text);
}

.emp-tag-missing {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 4px;
}

/* Stats en bas */
.planning-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}

.stat-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-val {
  font-size: 22px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  letter-spacing: -0.5px;
  color: var(--text);
}

.stat-val-small {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── PAGE PARAMÈTRES ── */

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.settings-card.danger {
  border-color: rgba(192, 57, 43, 0.25);
}

.settings-card-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.settings-card-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.settings-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Champs du solveur */
.settings-field {
  margin-bottom: 20px;
}
.settings-field:last-of-type {
  margin-bottom: 16px;
}

.settings-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.settings-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.settings-value {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 4px;
  color: var(--accent);
}

.settings-field-help {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

/* Slider */
input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.settings-saved {
  align-self: center;
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
}

/* ── TOASTS ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px 12px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  pointer-events: auto;
  min-width: 240px;
  max-width: 360px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.toast-msg {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.toast-close:hover { background: var(--bg); color: var(--text); }

.toast-success { border-left-color: var(--green); }
.toast-success .toast-icon { color: var(--green); }
.toast-error   { border-left-color: var(--red); }
.toast-error .toast-icon   { color: var(--red); }
.toast-warning { border-left-color: #F4C842; }
.toast-warning .toast-icon { color: #B89020; }
.toast-info    { border-left-color: var(--accent); }
.toast-info .toast-icon    { color: var(--accent); }

/* ── DRAG & DROP (planning) ── */
.emp-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: grab;
  user-select: none;
}
.emp-tag:active { cursor: grabbing; }
.emp-tag.dragging {
  opacity: 0.4;
}

.emp-tag-remove {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  opacity: 0;
  transition: all 0.15s;
}
.emp-tag:hover .emp-tag-remove { opacity: 1; }
.emp-tag-remove:hover {
  background: var(--red-light);
  color: var(--red);
}

/* Cellule cible mise en évidence pendant le drag */
.planning-cell-shift.drop-active {
  background: var(--accent-light);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

/* Surstaffé */
.cell-shift-header.overstaffed {
  color: #B89020;
}
.cell-shift-header.overstaffed .cell-shift-count {
  background: #FDF8E1;
  color: #B89020;
}

/* Cellule correctement staffée (have === need) */
.planning-cell-shift.ok {
  background: var(--green-light);
}
.planning-cell-shift.ok .cell-shift-header {
  border-bottom-color: rgba(45, 122, 79, 0.2);
  color: #1A5E36;
}
.planning-cell-shift.ok .cell-shift-count {
  background: white;
  color: var(--green);
}
.planning-cell-shift.ok .emp-tag {
  background: white;
}

/* Indication "modifié manuellement" sur les stats */
.stat-dirty {
  color: var(--accent);
  font-weight: 600;
}
.stat-dirty-label {
  color: var(--accent);
  font-style: italic;
}

/* Astuce sous le planning */
.planning-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── PAGE LOGIN ── */
body.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.04);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}

.login-logo-text {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.login-logo-sub {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.login-submit {
  width: 100%;
  padding: 12px !important;
  margin-top: 8px;
  font-size: 14px !important;
}

.login-error {
  font-size: 13px;
  color: var(--red);
  margin: 8px 0;
  min-height: 18px;
}

/* ── MENU UTILISATEUR (sidebar) ── */
.user-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 100;
}

.user-menu-item, a.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
}

.user-menu-item:hover {
  background: var(--bg);
}

.user-menu-item--danger { color: var(--red); }
a.user-menu-item { text-decoration: none; }

/* Cache le body tant que l'auth n'est pas validée — anti-flash sur les pages protégées */
body.auth-pending {
  visibility: hidden;
}

/* ── LÉGENDE CUISINES (vue globale planning) ── */
.planning-legend {
  display: flex;
  gap: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.tab-icon {
  font-size: 14px;
  font-weight: bold;
}

/* ── BARRE DE PROGRESSION GÉNÉRATION ── */
.generate-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 220px;
}
.generate-progress.hidden { display: none; }

.progress-bar-wrapper {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent, #4ade80);
  border-radius: 4px;
  transition: width 0.3s ease-out;
}

.progress-label {
  font-size: 13px;
  font-weight: 500;
  color: white;
  min-width: 38px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── STATUTS EMPLOYÉS ── */

/* Bordure colorée à gauche selon le statut */
.employee-card.statut-actif {
  border-left: 4px solid var(--green);
}
.employee-card.statut-formation {
  border-left: 4px solid #F4C842;
  background: #FFFEF7;
}
.employee-card.statut-archive {
  border-left: 4px solid var(--text-muted);
  opacity: 0.6;
}

/* Badge statut dans le nom */
.badge-statut {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}
.badge-statut.statut-actif {
  background: var(--green-light);
  color: #1A5E36;
}
.badge-statut.statut-formation {
  background: #FFF4D2;
  color: #8A6800;
}
.badge-statut.statut-archive {
  background: var(--border);
  color: var(--text-muted);
}

/* Select dans un form-group (cohérent avec les inputs)
   S'applique automatiquement à tout <select> dans un .form-group,
   ou avec la classe explicite .form-select. */
.form-select,
.form-group select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s;
}
.form-select:focus,
.form-group select:focus {
  border-color: var(--accent);
}

/* ── ZONE EMPLOYÉS EN FORMATION (planning vue par shift) ── */
.formation-zone {
  margin-top: 20px;
  background: #FFFEF7;
  border: 1px dashed #F4C842;
  border-radius: 12px;
  padding: 16px 20px;
}

.formation-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.formation-zone-title {
  font-size: 13px;
  font-weight: 600;
  color: #8A6800;
}

.formation-zone-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.formation-zone-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.formation-zone-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Pill formation : couleur jaune, peu importe où elle est */
.emp-tag.is-formation {
  background: #FFF4D2 !important;
  color: #8A6800;
  border: 1px solid #F4C842;
  font-weight: 500;
}

/* Pills dans la zone source : plus visibles, padding plus généreux */
.emp-tag.formation-source {
  padding: 6px 12px;
  font-size: 12px;
  cursor: grab;
}
.emp-tag.formation-source:active {
  cursor: grabbing;
}

/* Cellule qui contient au moins une formation : léger surlignage */
.planning-cell-shift.has-formation {
  background: #FFFCF0;
}
.planning-cell-shift.has-formation.ok {
  /* Si la cellule est OK ET a des formations, on garde le vert mais teinté */
  background: linear-gradient(to bottom, var(--green-light), #FFFCF0);
}

/* ── ZONE EMPLOYÉS ACTIFS (planning vue par shift) ── */
.active-zone {
  margin-top: 20px;
  background: var(--green-light);
  border: 1px dashed var(--green);
  border-radius: 12px;
  padding: 16px 20px;
}

.active-zone-title {
  font-size: 13px;
  font-weight: 600;
  color: #1A5E36;
}

.active-zone-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Pill actif (vert) */
.emp-tag.is-active {
  background: white !important;
  color: var(--green);
  border: 1px solid var(--green);
  font-weight: 500;
}

.emp-tag.active-source {
  padding: 6px 12px;
  font-size: 12px;
  cursor: grab;
}
.emp-tag.active-source:active {
  cursor: grabbing;
}

/* ── PAGE PUBLIQUE (saisie dispo employé via lien) ── */

body.public-body {
  background: var(--bg);
  min-height: 100vh;
  padding: 0;
  display: block;
  visibility: visible !important;  /* override anti-flash */
}

.public-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.public-header {
  text-align: center;
  margin-bottom: 24px;
}

.public-logo {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.public-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.public-intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.public-name {
  font-size: 15px;
}

.public-week {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.public-banner {
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.public-banner.pending {
  background: var(--surface);
  border: 1px dashed var(--border);
  color: var(--text);
}

.public-banner.submitted {
  background: var(--green-light);
  color: #1A5E36;
}

.public-banner.locked {
  background: #FDF8E1;
  color: #8A6800;
}

.public-banner.error {
  background: var(--red-light);
  color: var(--red);
  text-align: center;
}

.public-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.public-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.public-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.public-card-title {
  font-size: 14px;
  font-weight: 500;
  text-transform: capitalize;
}

.public-add {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.public-add:hover { background: var(--bg); color: var(--text); }

.public-plages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.public-empty {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.public-plage {
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-time {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.public-time:focus { border-color: var(--accent); }
.public-time:disabled { opacity: 0.6; cursor: not-allowed; }

.public-time-sep {
  color: var(--text-muted);
  font-size: 14px;
}

.public-remove {
  width: 32px; height: 32px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.public-remove:hover { background: var(--red-light); color: var(--red); }
.public-remove:disabled { opacity: 0.3; cursor: not-allowed; }

.public-submit-bar {
  position: sticky;
  bottom: 0;
  margin-top: 20px;
  padding: 14px 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.public-submit {
  width: 100%;
  padding: 14px !important;
  font-size: 15px !important;
}

/* Textarea cohérent avec les autres inputs settings */
.settings-card textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.15s;
}
.settings-card textarea:focus { border-color: var(--accent); }

.settings-field-help code {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--accent);
}

/* ── PANNEAU LIENS DISPOS (page Dispos restaurateur) ── */

.tokens-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

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

.tokens-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tokens-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 12px;
}

/* Bouton de pliage du panneau */
.tokens-toggle {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  flex: 1;
  min-width: 0;
  transition: color 0.15s;
}
.tokens-toggle:hover { color: var(--accent); }

.tokens-chevron {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.15s;
}
.tokens-toggle:hover .tokens-chevron { color: var(--accent); }

.tokens-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quand le panneau est replié, supprime l'espace inutile sous le header */
.tokens-panel.collapsed .tokens-header {
  margin-bottom: 0;
}

.tokens-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.token-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.token-row:last-child { border-bottom: none; }
.token-row.pending-token { opacity: 0.55; }

.token-info {
  flex: 1;
  min-width: 0;
}

.token-name {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.token-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: 'DM Mono', monospace;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.token-detail.muted { font-style: italic; }
.token-sep { opacity: 0.5; }

.token-url {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--accent);
  word-break: break-all;
}

.token-status {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
}
.token-status.submitted { background: var(--green-light); color: #1A5E36; }
.token-status.pending   { background: var(--bg); color: var(--text-muted); }

.token-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.token-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.token-btn:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--accent);
}
.token-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.token-btn.danger:hover {
  background: var(--red-light);
  border-color: var(--red);
}

.form-help {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}
.form-help code {
  font-family: 'DM Mono', monospace;
  font-style: normal;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent);
}

/* Boutons d'action en texte sur les cartes employés (plus lisibles que des icônes seules) */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-action:hover {
  background: var(--surface);
  border-color: var(--text-muted);
}

/* Sur la page Cuisines, les boutons .btn-action sont posés sur le fond de page (var(--bg)) */
/* On élargit le scope au .cuisine-editor pour couvrir aussi la barre d'actions */
.cuisine-editor .btn-action {
  background: var(--surface);
}
.cuisine-editor .btn-action:hover {
  background: var(--bg);
}

/* Variante destructive : reste sobre par défaut, devient rouge au hover pour avertir */
.cuisine-editor .btn-action.danger:hover {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red);
}

/* Onglet d'une cuisine archivée : visuellement plus discret */
.tab.archived {
  opacity: 0.55;
}
.tab.archived .tab-dot {
  filter: grayscale(0.6);
}

/* Variante : un toolbar-field sans label au-dessus, centré verticalement */
.toolbar-field-center {
  align-self: flex-end;
  padding-bottom: 10px;
}

.cuisines-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-action:disabled:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

/* Color picker custom (remplace l'input type=color natif moche) */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 0 2px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  padding: 0;
  outline: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  /* Anneau autour de la pastille pour marquer la sélection */
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface) inset;
}

.color-swatch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── PAGE ABSENCES ── */

.filter-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  cursor: pointer;
}
.filter-select:focus { border-color: var(--accent); }

.absence-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.absence-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  transition: border-color 0.15s;
}
.absence-card:hover { border-color: #D4D0C8; }
.absence-card.past  { opacity: 0.55; }

.absence-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: var(--bg);
  flex-shrink: 0;
}

.absence-info {
  flex: 1;
  min-width: 0;
}

.absence-name {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.absence-period {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.absence-motif {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 3px;
}

.absence-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.badge-type {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
}
.badge-type.type-vacances  { background: #E8F1FB; color: #2563A0; }
.badge-type.type-rtt       { background: #E6F4EA; color: #1A5E36; }
.badge-type.type-maladie   { background: #FBE6E6; color: #B92626; }
.badge-type.type-personnel { background: #F2EAFB; color: #6E3FA0; }
.badge-type.type-etudes    { background: #FEF7E0; color: #8A6800; }
.badge-type.type-autre     { background: var(--bg); color: var(--text-muted); }

.absence-icon.type-vacances  { background: #E8F1FB; }
.absence-icon.type-rtt       { background: #E6F4EA; }
.absence-icon.type-maladie   { background: #FBE6E6; }
.absence-icon.type-personnel { background: #F2EAFB; }
.absence-icon.type-etudes    { background: #FEF7E0; }
.absence-icon.type-autre     { background: var(--bg); }

/* ── MENU UTILISATEUR ── */
.user-menu-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.user-menu-item--danger:hover {
  background: var(--red-light);
  color: var(--red);
}

/* ── MODALE PROFIL ── */
.profile-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.profile-username {
  font-size: 15px;
  font-weight: 600;
}

.profile-role {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon input {
  width: 100%;
  padding-right: 40px;
}

.input-icon-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.input-icon-btn:hover { color: var(--text); }

.login-forgot {
  text-align: center;
  margin-top: 12px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  padding: 0;
  text-decoration: underline;
  transition: color 0.15s;
}
.btn-link:hover { color: var(--accent); }

.forgot-section { margin-top: 8px; }

.forgot-back { margin-bottom: 20px; }

.forgot-success {
  font-size: 13px;
  color: var(--green);
  background: var(--green-light);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.hidden { display: none !important; }

/* ── AJUSTEMENT HORAIRE ── */
.cell-shift-time {
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 4px;
  transition: background 0.15s;
}
.cell-shift-time:hover { background: rgba(0,0,0,0.06); }

.cell-shift-time.adjusted { color: var(--accent); }

.adjusted-dot {
  font-size: 8px;
  color: var(--accent);
  margin-left: 3px;
  vertical-align: middle;
}

.time-popover {
  position: absolute;
  z-index: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.time-popover-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.time-popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.time-popover-row label {
  font-size: 13px;
  color: var(--text);
  min-width: 36px;
}

.time-popover-row input[type="time"] {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  flex: 1;
}
.time-popover-row input[type="time"]:focus { border-color: var(--accent); }

.time-popover-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.envoi-preview {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
  white-space: pre-line;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  line-height: 1.6;
}

.envoi-sent {
  background: var(--green-light) !important;
  border-color: var(--green) !important;
  transition: background 0.3s;
}

.envoi-sent .token-name {
  color: var(--green);
  font-weight: 600;
}

.btn-envoi-sent {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 0 14px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.15s;
  display: flex;
  align-items: center;
}

.btn-envoi-sent:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-light);
}

.btn-envoi-sent.is-sent {
  background: var(--green-light);
  border-color: var(--green);
  color: var(--green);
}

.btn-envoi-sent.is-sent:hover {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red);
}

/* ── WEEK PANEL (dashboard) ── */
.week-panel-header {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.week-panel-num {
  font-size: 15px;
  font-weight: 600;
}

.week-panel-dates {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: 'DM Mono', monospace;
}

.week-panel-status {
  margin-bottom: 16px;
}

.wpill {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
}

/* Légende */
.wpill-envoye {
  background: var(--green-light);
  color: #1A5E36;
  border: 1px solid var(--green);
}
.wpill-none      { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.wpill-partial   { background: #FDF8E1; color: #B89020; border: 1px solid #F4C842; }
.wpill-generated {
  background: #FDF8E1;
  color: #B89020;
  border: 1px solid #F4C842;
}

.week-panel-section {
  margin-bottom: 16px;
}

.week-panel-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.week-panel-value {
  font-size: 13px;
  color: var(--text);
}

.week-panel-value.muted { color: var(--text-muted); font-style: italic; }

.week-panel-dispo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.week-panel-dispo-count {
  font-size: 18px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  min-width: 36px;
}

.week-panel-dispo-count.green  { color: var(--green); }
.week-panel-dispo-count.orange { color: #B89020; }

.week-panel-dispo-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.week-panel-dispo-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

.week-panel-missing {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.week-panel-missing.green {
  color: var(--green);
  font-style: normal;
  font-weight: 500;
}

.week-panel-action { margin-top: 20px; }

.week-panel-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.week-panel-actions-row a {
  flex: 1;
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 8px 10px !important;
  font-size: 12px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-input,
.public-time {
  font-family: 'DM Mono', monospace;
  letter-spacing: 1px;
}

.week-panel-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 10px;
}

/* ── PAGE HISTORIQUE ── */
.historique-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.historique-header {
  display: grid;
  grid-template-columns: 120px 1fr 200px 1fr;
  gap: 16px;
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.historique-row {
  display: grid;
  grid-template-columns: 120px 1fr 200px 1fr;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.historique-row:last-child { border-bottom: none; }
.historique-row:hover { background: var(--bg); }

.historique-num {
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
}

.historique-dates {
  font-size: 13px;
  color: var(--text-muted);
}

.historique-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.historique-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}