/* BeYurt Planning — Feuille de style */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* -------------------------------------------------------
   Variables & Reset
------------------------------------------------------- */
:root {
  --green:   #3d7a5e;
  --green-l: #7ec99a;
  --orange:  #e6821e;
  --orange-l:#f5a623;
  --red:     #c0392b;
  --red-l:   #e07070;
  --mauve-l: #c5b8e8;
  --holiday-l: #f5d98a;
  --grey:    #6c757d;
  --grey-l:  #f4f4f4;
  --border:  #dee2e6;
  --bg:      #ffffff;
  --toolbar-h: 52px;
  --navbar-h:  44px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 13px;
       background: #f0f2f5; color: #212529; }
button { cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 13px; }

/* -------------------------------------------------------
   Accès refusé
------------------------------------------------------- */
.access-denied {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: #f0f2f5;
}
.access-denied-box {
  background: #fff; border-radius: 12px; padding: 40px 48px;
  text-align: center; box-shadow: 0 2px 16px rgba(0,0,0,.08);
}
.access-denied-box h1 { font-size: 22px; margin: 12px 0 8px; color: var(--green); }
.access-denied-box p  { color: var(--grey); margin-bottom: 6px; }
.expired-msg { color: var(--orange); font-weight: 600; }
.btn-admin-link {
  display: inline-block; margin-top: 20px; padding: 8px 20px;
  background: var(--green); color: #fff; border-radius: 6px;
  text-decoration: none; font-weight: 600;
}

/* -------------------------------------------------------
   Toolbar
------------------------------------------------------- */
.toolbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--toolbar-h);
  background: var(--green); color: #fff;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.toolbar-left  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.toolbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.logo-badge {
  background: #fff; color: var(--green);
  font-weight: 800; font-size: 13px;
  border-radius: 6px; padding: 2px 7px;
}
.logo-initials {
  background: var(--green); color: #fff;
  font-weight: 800; font-size: 28px;
  border-radius: 10px; padding: 8px 14px;
  display: inline-block; margin-bottom: 12px;
}
.app-title { font-weight: 700; font-size: 15px; }

.btn-tool {
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px; padding: 5px 10px; font-size: 12px;
  text-decoration: none; display: inline-flex; align-items: center;
  transition: background .15s;
}
.btn-tool:hover   { background: rgba(255,255,255,.28); }
.btn-tool:disabled { opacity: .45; cursor: default; }
.btn-primary { background: rgba(255,255,255,.25); font-weight: 600; }
.multiselect-active { background: rgba(255,255,255,.4) !important; font-weight: 700; }

/* -------------------------------------------------------
   Barre de navigation
------------------------------------------------------- */
.nav-bar {
  position: fixed; top: var(--toolbar-h); left: 0; right: 0; z-index: 99;
  height: var(--navbar-h);
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
}
.view-tabs { display: flex; gap: 2px; }
.view-tab {
  background: transparent; border: none; border-radius: 6px;
  padding: 5px 10px; font-size: 12px; color: var(--grey);
  transition: background .12s, color .12s;
}
.view-tab:hover  { background: var(--grey-l); }
.view-tab.active { background: var(--green); color: #fff; font-weight: 600; }

.nav-arrows { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* Boutons zoom (mois/trimestre) */
.zoom-controls {
  display: flex; align-items: center; gap: 3px; margin-left: 10px;
}
.zoom-btn {
  background: var(--grey-l); border: 1px solid var(--border);
  border-radius: 5px; padding: 3px 8px;
  font-size: 14px; font-weight: 700; color: #555; line-height: 1;
}
.zoom-btn:hover { background: var(--border); }
.zoom-btn:disabled { opacity: .35; cursor: default; }
.zoom-label {
  font-size: 11px; color: var(--grey); min-width: 28px; text-align: center;
}
.nav-arrow {
  background: var(--grey-l); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; font-size: 14px; color: #444;
}
.nav-arrow:hover { background: var(--border); }
.today-btn { font-size: 11px; padding: 4px 8px; }
.period-label { font-size: 12px; color: var(--grey); min-width: 160px; text-align: center; }

/* -------------------------------------------------------
   Contenu principal
------------------------------------------------------- */
#app { padding-top: calc(var(--toolbar-h) + var(--navbar-h)); }
#mainContent { padding: 12px; }
.loading-msg { text-align: center; color: var(--grey); padding: 48px; font-size: 15px; }

/* -------------------------------------------------------
   Grille planning
------------------------------------------------------- */
.grid-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #bbb #f0f0f0;
}
.grid-wrapper::-webkit-scrollbar { height: 10px; }
.grid-wrapper::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 4px; }
.grid-wrapper::-webkit-scrollbar-thumb { background: #bbb; border-radius: 4px; }

.planning-table {
  border-collapse: collapse;
  table-layout: fixed;
  white-space: nowrap;
}
/* En vue semaine : le tableau remplit toute la largeur */
.planning-table.full-width { width: 100%; }
.planning-table th, .planning-table td {
  border: 1px solid var(--border);
  padding: 0;
  vertical-align: top;
}

/* Colonne noms */
.col-name {
  width: 120px; min-width: 120px; max-width: 120px;
  position: sticky; left: 0; z-index: 10;
  background: #fff;
}
.col-name.th-name {
  z-index: 20; background: #f8f9fa;
  padding: 6px 8px; font-weight: 700; font-size: 12px;
  border-bottom: 2px solid var(--border);
}
.worker-name-cell {
  padding: 5px 10px; font-weight: 600; font-size: 12px;
  letter-spacing: .01em;
  background: #fff; display: flex; align-items: center; gap: 8px;
  min-height: 40px;
}
.worker-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
/* Remplacement du dot par un cercle avec initiales */
.worker-initials {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 800; letter-spacing: -.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

/* Colonnes jours — largeur gérée par <colgroup> dans renderGrid() */
.col-day { }

.th-day {
  padding: 5px 2px; text-align: center; font-size: 11px;
  background: #f0f4f8; border-bottom: 2px solid #c8d4e0;
  cursor: default;
}
.th-day .day-name { font-weight: 700; display: block; text-transform: uppercase; font-size: 10px; letter-spacing: .04em; }
.th-day .day-num  { color: #555; display: block; font-size: 13px; font-weight: 600; margin-top: 1px; }
.th-day.today-col { background: #e8f5ef; }
.th-day.today-col .day-name { color: var(--green); }

/* Cellules disponibilité */
.avail-cell {
  min-height: 58px; padding: 7px 8px;
  cursor: pointer; position: relative;
  transition: filter .1s;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  white-space: normal; overflow-wrap: break-word; word-break: break-word;
}
.avail-cell:hover { filter: brightness(.93); }
.avail-cell.avail   { background: var(--green-l); }
.avail-cell.maybe   { background: var(--orange-l); }
.avail-cell.unavail { background: var(--red-l); }
.avail-cell.empty   { background: #fff; }
.avail-cell.selected { outline: 2px solid #0d6efd; outline-offset: -2px; }
.avail-cell.weekend  { background: var(--mauve-l); }
.avail-cell.holiday  { background: var(--holiday-l); }

/* Statut sur jours fériés/week-ends : bordure colorée en bas (le fond spécial est conservé) */
.avail-cell.weekend.avail,  .avail-cell.holiday.avail   { border-bottom: 4px solid var(--green); }
.avail-cell.weekend.maybe,  .avail-cell.holiday.maybe   { border-bottom: 4px solid var(--orange); }
.avail-cell.weekend.unavail,.avail-cell.holiday.unavail { border-bottom: 4px solid var(--red); }

/* Texte dans les cellules */
.cell-note, .cell-assigned {
  font-size: 11px; line-height: 1.4;
  max-width: calc(100% - 4px);
  white-space: normal; word-break: break-word;
  display: block;
}
.cell-note {
  color: #222;
  font-style: italic;
  font-weight: 500;
}

/* Bouton "+" pour note masquée (vue mois/trimestre) */
.cell-note-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: rgba(0,0,0,.22); color: #fff;
  border: none; font-size: 10px; font-weight: 800;
  cursor: pointer; flex-shrink: 0; line-height: 1;
  padding: 0;
}
.cell-note-btn:hover { background: rgba(0,0,0,.40); }

/* Bulle flottante de note */
.note-tooltip {
  position: fixed; z-index: 600;
  background: #2c3e50; color: #fff;
  padding: 7px 11px; border-radius: 7px;
  font-size: 12px; font-style: italic;
  max-width: 200px; white-space: normal; word-break: break-word;
  box-shadow: 0 3px 12px rgba(0,0,0,.28);
  pointer-events: none;
  line-height: 1.5;
}

/* Badges activités dans les cellules ouvrier */
.badge-act {
  display: inline-block; font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  color: #fff;
  cursor: pointer;
  max-width: calc(100% - 8px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.6;
  align-self: flex-start;
}
.badge-act:hover { opacity: .82; }

/* Couleur de la bordure gauche selon le type */
.badge-act.act-chantier   { border-left-color: #2e6da4; }
.badge-act.act-atelier    { border-left-color: #3d7a5e; }
.badge-act.act-logistique { border-left-color: #b05a2f; }
.badge-act.act-entretien  { border-left-color: #7a3d7a; }
.badge-act.act-autre      { border-left-color: #7a6a3d; }

/* Couleurs de fond des badges = même que les barres Gantt */
/* Héritées de .act-chantier, .act-atelier, etc. — pas d'override nécessaire */

/* ---- En-tête de section Activités ---- */
.act-section-header { background: #2c3e50; }
.act-section-label {
  padding: 5px 10px;
  font-size: 10px; font-weight: 800; letter-spacing: .1em;
  color: rgba(255,255,255,.75);
  text-transform: uppercase;
  position: sticky; left: 0;
}

/* ---- Lignes activités Gantt ---- */
.act-row-label { background: #dde4ed; }
.act-row-type-label {
  padding: 4px 10px;
  font-size: 11px; font-weight: 700;
  color: #34495e;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #dde4ed;
}
.act-row-new { background: #eaf0f6; }
.act-row-new-label {
  color: var(--green); font-size: 11px; font-weight: 700;
  background: #eaf0f6;
}
.act-track-cell { padding: 3px 2px; vertical-align: middle; background: #dde4ed; height: 34px; }
.act-row-new .act-track-cell { background: #eaf0f6; height: 34px; }
/* Cellules vides cliquables dans les lignes activités */
.act-cell-add { cursor: pointer; }
.act-cell-add:hover { background: rgba(44,62,80,.10) !important; }

/* ---- Séparateur visuel entre activités et équipe ---- */
.workers-section-header { background: #1a5c42; border-top: 4px solid #0d3d2a; }
.workers-section-label {
  padding: 7px 10px;
  font-size: 10px; font-weight: 800; letter-spacing: .1em;
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
  position: sticky; left: 0;
}

/* ---- Lignes ouvriers ---- */
.worker-row {
  background: #fff;
  border-bottom: 2px solid #d4dce6;
  transition: background .1s;
}
.worker-row:nth-child(even) { background: #f7f9fb; }
.worker-row:nth-child(even) .worker-name-cell { background: #f7f9fb; }
.worker-row:nth-child(even) .avail-cell.empty { background: #f7f9fb; }
.worker-row:hover { background: #f0f4f8 !important; }
.worker-row:hover .worker-name-cell { background: #f0f4f8 !important; }
.act-bar {
  display: flex; align-items: center;
  height: 28px; border-radius: 5px;
  padding: 0 8px; cursor: grab;
  font-size: 12px; font-weight: 600; color: #fff;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  user-select: none;
}
.act-bar:active { cursor: grabbing; }
.act-bar:hover { opacity: .85; }
.act-bar .resize-handle {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 12px; cursor: col-resize; opacity: .45;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.act-bar .resize-handle:hover { opacity: 1; }

/* Cellule ciblée pendant un drag d'affectation */
.drag-assign-target {
  outline: 3px solid var(--green) !important;
  outline-offset: -3px;
  background: rgba(61,122,94,.22) !important;
  transition: none;
}

/* Ghost de drag */
.gantt-drag-ghost {
  cursor: grabbing !important;
  opacity: 0.78 !important;
  box-shadow: 0 6px 20px rgba(0,0,0,.45) !important;
  outline: 2px dashed rgba(255,255,255,.7);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* Ligne résumé */
.summary-row td { background: #f8f9fa; padding: 3px 4px; }
.summary-count { font-size: 11px; font-weight: 700; color: var(--green); text-align: center; }
.summary-bar-wrap { height: 4px; background: var(--border); border-radius: 2px; margin-top: 2px; }
.summary-bar-fill { height: 4px; background: var(--green); border-radius: 2px; transition: width .3s; }

/* Couleurs activités */
.act-chantier   { background: #2e6da4; }
.act-atelier    { background: #3d7a5e; }
.act-logistique { background: #b05a2f; }
.act-entretien  { background: #7a3d7a; }
.act-autre      { background: #7a6a3d; }

/* -------------------------------------------------------
   Vue Jour
------------------------------------------------------- */
.day-view { max-width: 700px; margin: 0 auto; }
.day-section-title {
  font-weight: 700; font-size: 13px; color: var(--grey);
  text-transform: uppercase; letter-spacing: .05em;
  margin: 16px 0 8px;
}
.day-activities { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.day-act-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px; color: #fff;
  cursor: pointer; font-size: 13px;
}
.day-act-card:hover { opacity: .9; }
.day-act-label { font-weight: 700; }
.day-act-dates { font-size: 11px; opacity: .85; }
.no-activities { color: var(--grey); font-style: italic; font-size: 12px; }

.day-workers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.worker-day-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  cursor: pointer; transition: box-shadow .15s;
}
.worker-day-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.worker-day-card .wdc-name {
  font-weight: 700; font-size: 13px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.wdc-status { font-size: 12px; margin-bottom: 4px; }
.wdc-note   { font-size: 11px; color: var(--grey); font-style: italic; }
.wdc-badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }

/* -------------------------------------------------------
   Vue Mon planning
------------------------------------------------------- */
.myplan-view { max-width: 700px; margin: 0 auto; }

/* Sélecteur d'ouvrier */
.myplan-worker-selector {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.myplan-worker-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  border: 2px solid var(--border); background: #fff;
  font-size: 12px; font-weight: 600; color: #444;
  transition: all .12s;
}
.myplan-worker-btn:hover { border-color: var(--wcolor); color: var(--wcolor); }
.myplan-worker-btn.active {
  border-color: var(--wcolor); background: var(--wcolor); color: #fff;
}
.myplan-worker-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.week-block { margin-bottom: 20px; }
.week-block-title {
  font-weight: 700; font-size: 12px; color: var(--grey);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.myplan-day-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.myplan-day-row:hover { background: #fafafa; }
.myplan-day-label {
  width: 90px; flex-shrink: 0;
  font-size: 12px; font-weight: 600; color: #444;
}
.myplan-day-label.today { color: var(--green); }
.myplan-day-label.weekend { color: #aaa; }
.myplan-day-content { flex: 1; }
.myplan-status { font-size: 12px; margin-bottom: 2px; }
.myplan-note   { font-size: 11px; color: var(--grey); font-style: italic; }
.myplan-badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }

/* -------------------------------------------------------
   Barre flottante (sélection multiple)
------------------------------------------------------- */
.float-bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #222; color: #fff;
  border-radius: 10px; padding: 10px 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(0,0,0,.35); z-index: 200;
  max-width: calc(100vw - 24px);
}
.float-bar.hidden { display: none; }
.float-count { font-size: 12px; font-weight: 600; margin-right: 4px; }
.float-btn {
  border: none; border-radius: 6px;
  padding: 5px 10px; font-size: 12px; font-weight: 600; color: #fff;
}
.float-btn.avail   { background: var(--green); }
.float-btn.maybe   { background: var(--orange); }
.float-btn.unavail { background: var(--red); }
.float-btn.empty   { background: var(--grey); }
.float-btn.note    { background: #444; }
.float-btn.cancel  { background: transparent; border: 1px solid #666; }

/* -------------------------------------------------------
   Toast
------------------------------------------------------- */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 8px 18px;
  border-radius: 20px; font-size: 13px; z-index: 300;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  transition: opacity .3s;
}
.toast.hidden { display: none; }

/* -------------------------------------------------------
   Modals
------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }
.modal-box {
  background: #fff; border-radius: 12px;
  padding: 24px; width: 380px; max-width: calc(100vw - 24px);
  position: relative; box-shadow: 0 8px 32px rgba(0,0,0,.18);
  max-height: calc(100vh - 40px); overflow-y: auto;
}
.modal-box.small { width: 320px; }
.modal-title {
  font-weight: 700; font-size: 16px; margin-bottom: 16px;
  color: var(--green);
}
.btn-close {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: none;
  font-size: 18px; color: var(--grey); line-height: 1;
}
.btn-close:hover { color: #333; }

/* Sélecteur statut */
.status-picker {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 12px;
}
.status-btn {
  padding: 8px; border: none; border-radius: 8px;
  color: #fff; font-weight: 600; font-size: 13px;
}
.status-btn.avail   { background: var(--green); }
.status-btn.maybe   { background: var(--orange); }
.status-btn.unavail { background: var(--red); }
.status-btn.empty   { background: var(--grey); }

.note-row {
  display: flex; gap: 8px; margin-top: 8px;
}
.note-row input { flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }

/* Formulaire activité */
.form-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.form-row label { width: 56px; flex-shrink: 0; font-weight: 600; font-size: 12px; color: var(--grey); }
.form-row input, .form-row select, .form-row textarea {
  flex: 1; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
}
.form-row textarea { resize: vertical; }

.workers-section { margin: 12px 0; }
.workers-section-title { font-weight: 700; font-size: 12px; color: var(--grey); margin-bottom: 8px; }
.workers-checklist { display: flex; flex-wrap: wrap; gap: 6px; }
.worker-check-btn {
  padding: 4px 10px; border-radius: 16px; border: 2px solid var(--border);
  font-size: 12px; background: #fff; color: #444;
  transition: all .12s;
}
.worker-check-btn.selected {
  border-color: var(--green); background: var(--green-l); color: var(--green); font-weight: 700;
}

/* Actions modal */
.modal-actions {
  display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap;
}
.btn-save   { padding: 8px 18px; background: var(--green); color: #fff; border: none; border-radius: 6px; font-weight: 700; }
.btn-cancel { padding: 8px 18px; background: var(--grey-l); color: #333; border: 1px solid var(--border); border-radius: 6px; }
.btn-danger { padding: 8px 18px; background: var(--red); color: #fff; border: none; border-radius: 6px; font-weight: 700; }
.hidden { display: none !important; }

/* Inputs note dans modal */
#noteModal input, #noteInput {
  width: 100%; padding: 8px; border: 1px solid var(--border);
  border-radius: 6px; margin-bottom: 12px;
}

/* -------------------------------------------------------
   Menu contextuel badge
------------------------------------------------------- */
.badge-menu {
  position: fixed; z-index: 500;
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.15);
  padding: 6px 0; min-width: 220px;
}
.badge-menu.hidden { display: none; }
.badge-menu-title {
  padding: 8px 14px 6px; font-weight: 700; font-size: 12px;
  color: var(--grey); border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.badge-menu button {
  display: block; width: 100%;
  text-align: left; padding: 7px 14px;
  background: transparent; border: none;
  font-size: 13px; color: #333;
}
.badge-menu button:hover { background: var(--grey-l); }

/* -------------------------------------------------------
   Interface admin
------------------------------------------------------- */
.admin-page {
  max-width: 900px; margin: 0 auto; padding: 24px 16px;
  padding-top: calc(var(--toolbar-h) + var(--navbar-h) + 12px);
}
.admin-section { margin-bottom: 32px; }
.admin-section-title {
  font-size: 16px; font-weight: 700; color: var(--green);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--green-l);
}
.workers-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.workers-table th {
  background: #f8f9fa; padding: 8px 12px;
  text-align: left; font-size: 12px; color: var(--grey);
  border-bottom: 1px solid var(--border);
}
.workers-table td { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.workers-table tr:last-child td { border-bottom: none; }
.token-link { font-family: monospace; font-size: 11px; color: var(--grey); word-break: break-all; }
.btn-sm { padding: 3px 8px; font-size: 11px; border-radius: 4px; border: 1px solid var(--border); background: #fff; }
.btn-sm:hover { background: var(--grey-l); }
.btn-sm.danger { color: var(--red); border-color: var(--red); }
.qr-cell img { width: 48px; height: 48px; }

/* -------------------------------------------------------
   En-tête d'impression (masqué à l'écran)
------------------------------------------------------- */
.print-header { display: none; }

/* -------------------------------------------------------
   Select mobile (caché sur desktop)
------------------------------------------------------- */
.view-select { display: none; }

/* -------------------------------------------------------
   Responsive
------------------------------------------------------- */
@media (max-width: 600px) {
  /* La nav-bar passe en 2 rangées → on augmente sa hauteur effective */
  :root { --navbar-h: 80px; }

  .app-title { display: none; }
  .col-name { width: 80px; min-width: 80px; max-width: 80px; }
  .modal-box { padding: 16px; }

  /* Nav-bar : 2 rangées empilées */
  .nav-bar {
    height: auto;
    flex-wrap: wrap;
    padding: 4px 8px;
    gap: 4px;
    align-content: flex-start;
  }

  /* Rangée 1 : onglets masqués, select affiché */
  .view-tabs { display: none; }

  .view-select {
    display: block;
    width: 100%;
    padding: 7px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--green);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    /* Flèche personnalisée blanche */
    appearance: none;
    -webkit-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='%23fff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
  }
  .view-select option { background: #fff; color: #212529; font-weight: 600; }

  /* Rangée 2 : flèches + libellé de période + zoom */
  .nav-arrows {
    width: 100%;
    margin-left: 0;
    justify-content: center;
    gap: 6px;
  }
  .period-label { min-width: 90px; font-size: 13px; }
  .nav-arrow    { font-size: 18px; padding: 4px 12px; }
  .today-btn    { font-size: 13px; padding: 4px 10px; }
  .zoom-btn     { font-size: 16px; padding: 3px 10px; }
  .zoom-label   { font-size: 12px; }
}

/* -------------------------------------------------------
   Impression — A4 paysage
------------------------------------------------------- */
@media print {
  @page { size: A4 landscape; margin: 8mm 10mm; }

  /* Force les couleurs de fond à l'impression */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* Masquer tout ce qui n'est pas le contenu */
  .toolbar, .nav-bar, .float-bar, .toast,
  .modal, #badgeMenu, .note-tooltip,
  .zoom-controls, .resize-handle,
  .act-cell-add { display: none !important; }

  /* Supprimer les marges liées à la toolbar fixe */
  #app { padding-top: 0 !important; }
  #mainContent { padding: 0 !important; }

  /* En-tête d'impression */
  .print-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 5mm;
    margin-bottom: 4mm;
    border-bottom: 2px solid var(--green);
  }
  .print-header-left { display: flex; align-items: center; gap: 8px; }
  .print-logo-badge {
    background: var(--green); color: #fff;
    font-weight: 800; font-size: 13px;
    border-radius: 5px; padding: 2px 7px;
  }
  .print-title { font-weight: 700; font-size: 14px; color: var(--green); }
  .print-header-center { font-weight: 600; font-size: 12px; color: #333; }
  .print-header-right { font-size: 11px; color: var(--grey); }

  /* Grille */
  .grid-wrapper {
    overflow: visible !important;
    border: 1px solid #bbb !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .planning-table { font-size: 10px !important; width: 100% !important; }

  /* Désactiver le sticky (incompatible avec l'impression dans la plupart des navigateurs) */
  .col-name, .th-name, .act-section-label,
  .workers-section-label { position: static !important; }

  /* Cellules */
  .avail-cell { min-height: 36px !important; padding: 4px 5px !important; }
  .avail-cell:hover { filter: none !important; }

  /* Barres Gantt */
  .act-bar {
    box-shadow: none !important;
    cursor: default !important;
    font-size: 10px !important;
    height: 22px !important;
  }
  .act-track-cell { height: 26px !important; }

  /* Badges */
  .badge-act { cursor: default !important; font-size: 8px !important; }

  /* Bouton note caché */
  .cell-note-btn { display: none !important; }

  /* Ligne résumé */
  .summary-row td { background: #f8f9fa !important; }
}
