/* ============================================================
   PlaniPharma V7 — Feuille de styles principale
   ============================================================ */

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}

/* ---- Variables CSS ---- */
:root {
  --blue:     #2563eb;
  --blue-lt:  #dbeafe;
  --violet:   #7c3aed;
  --green:    #16a34a;
  --green-lt: #dcfce7;
  --purple:   #9333ea;
  --purple-lt:#f3e8ff;
  --red:      #dc2626;
  --red-lt:   #fee2e2;
  --amber:    #d97706;
  --amber-lt: #fef3c7;
  --gray:     #6b7280;
  --gray-lt:  #f3f4f6;

  --sidebar-w: 220px;
  --header-h:  52px;
  --tabs-h:    44px;
  --radius:    10px;
  --shadow:    0 2px 12px rgba(0,0,0,.08);
}

/* ============================================================
   LAYOUT PRINCIPAL (app connectée) — onglets en haut
   ============================================================ */
.app-wrap {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---- Footer légal ---- */
.app-footer {
  flex-shrink: 0;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: .55rem 1.5rem;
  text-align: center;
}
.app-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .25rem;
}
.app-footer-links a {
  font-size: .73rem;
  color: #64748b;
  text-decoration: none;
  transition: color .15s;
}
.app-footer-links a:hover { color: #2563eb; }
.app-footer-links span    { color: #cbd5e1; font-size: .7rem; }
.app-footer-copy {
  font-size: .7rem;
  color: #94a3b8;
  margin: 0;
}

/* ---- Header ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e3a5f;
  color: #fff;
  border-bottom: 1px solid #14243d;
  padding: 0 1.25rem;
  gap: 1rem;
  height: var(--header-h);
  flex-shrink: 0;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.app-header .app-logo { color: #fff; }
.app-header .app-pharma-name { color: rgba(255,255,255,.85); }
.app-header .btn-secondary { background: rgba(255,255,255,.15); color: #fff; }
.app-header .btn-secondary:hover { background: rgba(255,255,255,.25); opacity: 1; }
.app-header .badge-blue  { background: rgba(59,130,246,.3); color: #dbeafe; }
.app-header .badge-amber { background: rgba(251,191,36,.9); color: #78350f; }
.app-header .badge-gray  { background: rgba(255,255,255,.15); color: #e2e8f0; }
.app-logo {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.2rem; color: var(--blue);
  text-decoration: none;
}
.app-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
}
.app-pharma-name {
  font-size: .95rem; font-weight: 600; color: #475569;
}
.app-user-btn {
  display: flex; align-items: center; gap: .5rem;
  background: var(--gray-lt); border: none;
  padding: .4rem .9rem; border-radius: 20px;
  cursor: pointer; font-size: .9rem; color: #374151;
  transition: background .2s;
}
.app-user-btn:hover { background: #e5e7eb; }

/* ============================================================
   ONGLETS HORIZONTAUX (navigation principale)
   ============================================================ */
.app-tabs {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 1.25rem;
  height: var(--tabs-h);
  flex-shrink: 0;
  gap: .15rem;
  /* overflow: visible pour que les dropdowns puissent déborder vers le bas */
  overflow: visible;
  z-index: 15;
  position: relative;
}
.app-tab {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: 0 1rem;
  color: #475569; font-size: .9rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: none;
  background: transparent;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.app-tab:hover { color: var(--blue); background: #f8fafc; }
.app-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  background: #f1f5f9;
}
.app-tab .icon { font-size: 1rem; }
.app-tab-spacer { flex: 1; }

/* Menu déroulant (dropdown) */
.app-menu {
  position: relative;
  display: flex;
  align-items: stretch;
}
.app-menu-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: 0 .9rem; height: 100%;
  color: #475569; font-size: .9rem; font-weight: 600;
  background: transparent; border: none; cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, background .15s;
}
.app-menu-btn:hover { color: var(--blue); background: #f8fafc; }
.app-menu-btn .caret { font-size: .7rem; opacity: .6; }
.app-menu-panel {
  position: absolute; top: 100%; left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  padding: .35rem;
  display: none;
  z-index: 30;
}
/* Variante alignée à droite (ex. Export en fin de barre) */
.app-menu.menu-right .app-menu-panel { left: auto; right: 0; }
.app-menu.open .app-menu-panel { display: block; }
.app-menu-item {
  display: flex; align-items: center; gap: .55rem;
  width: 100%; padding: .55rem .7rem;
  color: #374151; font-size: .88rem; font-weight: 500;
  background: transparent; border: none; text-align: left;
  border-radius: 7px; cursor: pointer;
  text-decoration: none;
  transition: background .12s;
}
.app-menu-item:hover { background: var(--blue-lt); color: var(--blue); }
.app-menu-item .icon { font-size: 1rem; min-width: 20px; text-align: center; }
.app-menu-sep {
  height: 1px; background: #e5e7eb; margin: .35rem .15rem;
}
.app-menu-header {
  font-size: .68rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .08em;
  padding: .5rem .7rem .2rem;
}

/* ============================================================
   CORPS APP : 2 colonnes optionnelles (sidebar facultative)
   ============================================================ */
.app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Sidebar liste salariés (uniquement utilisé sur page Planning) */
.app-sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  flex-shrink: 0;
  transition: width .22s ease, border-color .22s ease;
}
.app-sidebar.sidebar-collapsed {
  width: 0;
  border-right: none;
  overflow: hidden;
}
.app-sidebar .sidebar-header {
  padding: .7rem 1rem;
  font-size: .7rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 1px solid #eee;
}
.employee-list {
  padding: .15rem 0;
}
.employee-item {
  padding: .55rem .85rem;
  border-bottom: 1px solid #f2f2f2;
  display: flex; align-items: flex-start; gap: .5rem;
}
.employee-item:last-child { border-bottom: none; }
.emp-info { flex: 1; min-width: 0; }
.employee-name {
  font-weight: 600; font-size: .85rem; color: #1e293b;
  line-height: 1.3;
}
.employee-stats {
  font-size: .72rem; color: #64748b; margin-top: .2rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .2rem;
}
.qual-badge {
  display: inline-block;
  padding: .1rem .4rem; border-radius: 10px;
  font-size: .62rem; font-weight: 700;
}

/* Contenu principal */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  background: #f1f5f9;
}

/* Anciennes classes .nav-item conservées pour compat (listes internes) */
.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem 1.25rem;
  color: #374151; font-size: .92rem;
  text-decoration: none; cursor: pointer; border: none;
  background: none; width: 100%;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--gray-lt); color: var(--blue); }
.nav-item.active {
  background: var(--blue-lt); color: var(--blue);
  border-left-color: var(--blue); font-weight: 600;
}
.nav-item .icon { font-size: 1.1rem; min-width: 22px; text-align: center; }
.nav-divider { height: 1px; background: #e5e7eb; margin: .6rem 1rem; }
.nav-label {
  font-size: .72rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .08em;
  padding: .4rem 1.25rem 0;
}

/* ============================================================
   COMPOSANTS COMMUNS
   ============================================================ */

/* Cards */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.card-title {
  font-size: 1rem; font-weight: 700; color: #1e293b;
  margin-bottom: 1rem;
}

/* Boutons */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem; border-radius: 8px;
  font-size: .9rem; font-weight: 600;
  cursor: pointer; border: none; transition: opacity .2s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-secondary { background: var(--gray-lt); color: #374151; }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-violet { background: var(--violet); color: #fff; }
.btn-sm { padding: .35rem .8rem; font-size: .82rem; }
.btn:hover { opacity: .88; }

/* Badges */
.badge {
  display: inline-block;
  padding: .2rem .55rem; border-radius: 20px;
  font-size: .75rem; font-weight: 700; line-height: 1.4;
}
.badge-blue   { background: var(--blue-lt); color: var(--blue); }
.badge-green  { background: var(--green-lt); color: var(--green); }
.badge-purple { background: var(--purple-lt); color: var(--purple); }
.badge-red    { background: var(--red-lt); color: var(--red); }
.badge-amber  { background: var(--amber-lt); color: var(--amber); }
.badge-gray   { background: var(--gray-lt); color: var(--gray); }

/* ============================================================
   AVATARS (photo de profil OU initiales)
   ============================================================ */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #e5e7eb;
  border: 2px solid #e5e7eb;
  display: inline-block; vertical-align: middle;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; border-width: 2px; }
.avatar-lg { width: 64px; height: 64px; border-width: 3px; }
.avatar-xl { width: 120px; height: 120px; border-width: 4px; }

.avatar-placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
  text-transform: uppercase;
  font-size: .85rem;
  letter-spacing: .02em;
  border-color: transparent;
}
.avatar-placeholder.avatar-sm { font-size: .7rem; }
.avatar-placeholder.avatar-lg { font-size: 1.4rem; }
.avatar-placeholder.avatar-xl { font-size: 2.6rem; }

/* ============================================================
   BOUTONS-ICÔNES (icône seule, compact)
   ============================================================ */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  color: #475569;
  transition: background .15s, border-color .15s, color .15s;
  padding: 0;
}
.btn-icon:hover { background: var(--blue-lt); border-color: var(--blue); color: var(--blue); }
.btn-icon-xs {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; font-size: .85rem;
  border-radius: 5px; border: none; background: transparent;
  color: #94a3b8; text-decoration: none; cursor: pointer;
  flex-shrink: 0;
}
.btn-icon-xs:hover { background: var(--blue-lt); color: var(--blue); }

/* ============================================================
   CELLULES ABSENCES (overlay dans le planning mensuel)
   ============================================================ */
.month-grid .cell-day.abs-at        { background: #fee2e2 !important; }
.month-grid .cell-day.abs-maternite { background: #fae8ff !important; }
.month-grid .cell-day.abs-paternite { background: #dbeafe !important; }
.month-grid .cell-day.abs-naissance { background: #dcfce7 !important; }

.abs-badge {
  display: inline-block;
  padding: .08rem .35rem; border-radius: 4px;
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em;
}
.abs-badge-at        { background: var(--red-lt);    color: var(--red); }
.abs-badge-maternite { background: var(--purple-lt); color: var(--purple); }
.abs-badge-paternite { background: var(--blue-lt);   color: var(--blue); }
.abs-badge-naissance { background: var(--green-lt);  color: var(--green); }

/* Card title (utilisé dans fiche / paramètres) */
.card-title {
  font-size: 1rem; font-weight: 700; color: #1e293b;
  margin-bottom: .85rem;
  display: flex; align-items: center; gap: .4rem;
}

/* Formulaires */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: .35rem; }
.form-control {
  width: 100%; padding: .55rem .85rem;
  border: 1px solid #d1d5db; border-radius: 8px;
  font-size: .95rem; color: #1e293b;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
select.form-control { cursor: pointer; }

/* Alertes */
.alert { padding: .85rem 1rem; border-radius: 8px; font-size: .9rem; margin-bottom: 1rem; }
.alert-error  { background: var(--red-lt); color: #991b1b; border: 1px solid #fca5a5; }
.alert-success{ background: var(--green-lt); color: #14532d; border: 1px solid #86efac; }
.alert-info   { background: var(--blue-lt); color: #1e40af; border: 1px solid #93c5fd; }
.alert-warning{ background: var(--amber-lt); color: #92400e; border: 1px solid #fcd34d; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: #f8fafc; color: #475569; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: .65rem 1rem; text-align: left; border-bottom: 2px solid #e2e8f0; }
td { padding: .6rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:hover td { background: #fafafa; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border-radius: 14px;
  box-shadow: 0 16px 64px rgba(0,0,0,.2);
  width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95); transition: transform .2s;
}
.modal-backdrop.open .modal { transform: scale(1); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #94a3b8; line-height: 1; }
.modal-close:hover { color: #1e293b; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid #e5e7eb; display: flex; gap: .75rem; justify-content: flex-end; }

/* Spinner */
.spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 3px solid #e5e7eb; border-top-color: var(--blue);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast notification */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  padding: .75rem 1.25rem; border-radius: 10px;
  font-size: .9rem; font-weight: 500; color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  animation: slideIn .3s ease;
}
.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }
.toast-info    { background: var(--blue); }
@keyframes slideIn { from { transform: translateX(120%); opacity:0; } to { transform: translateX(0); opacity:1; } }

/* ============================================================
   PLANNING — VUE MENSUELLE
   ============================================================ */
.planning-month { }
.planning-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}
.planning-nav h2 { font-size: 1.2rem; font-weight: 700; text-align: center; white-space: nowrap; margin: 0; }

/* Switcher Mois / Semaine / Jour */
.view-switch {
  display: inline-flex;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.view-switch .view-btn {
  padding: .4rem .85rem;
  background: transparent;
  border: none;
  font-size: .82rem; font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-right: 1px solid #e2e8f0;
  transition: background .15s, color .15s;
}
.view-switch .view-btn:last-child { border-right: none; }
.view-switch .view-btn:hover { background: #f8fafc; color: var(--blue); }
.view-switch .view-btn.active {
  background: var(--blue);
  color: #fff;
}

/* Wrapper scroll horizontal — isole le scroll X de la page */
.month-grid-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
}

.month-grid {
  display: grid;
  /* Colonnes définies dynamiquement par JS */
  grid-template-columns: 125px repeat(31, minmax(22px, 1fr));
  gap: 1px;
  background: #e2e8f0;
  border-radius: var(--radius);
  font-size: .8rem;
  width: 100%;
  min-width: 640px; /* assure le scroll sur petits écrans */
}

/* ── Cellule de base ── */
.month-grid .cell {
  background: #fff;
  min-height: 32px;
  padding: 2px 3px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
}

/* ── En-têtes colonnes (sticky haut) ── */
.month-grid .cell-header {
  position: sticky; top: 0; z-index: 3;
  background: #f8fafc;
  font-weight: 700; font-size: .7rem;
  color: #475569; text-transform: uppercase;
  height: 30px;
}
.month-grid .cell-header.weekend { background: #f1f5f9; color: #94a3b8; }
.month-grid .cell-header.today-col {
  background: #dbeafe; color: var(--blue,#2563eb);
  border-bottom: 2px solid var(--blue,#2563eb);
}

/* ── Colonne nom (sticky gauche) ── */
.month-grid .cell-name {
  position: sticky; left: 0; z-index: 2;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: .3rem;
  padding: .2rem .4rem;
  font-weight: 600;
  text-align: left;
  min-width: 0;
  background: #fff; /* opaque obligatoire pour sticky */
  box-shadow: 2px 0 4px rgba(0,0,0,.06);
}
/* Coin supérieur gauche : sticky haut + gauche */
.month-grid .cell-header:first-child {
  position: sticky; top: 0; left: 0; z-index: 5;
  box-shadow: 2px 2px 4px rgba(0,0,0,.07);
}
/* Alternance de fond sur les lignes (appliquée à cell-name) */
.month-grid .cell-name.row-odd  { background: #ffffff; }
.month-grid .cell-name.row-even { background: #f8fafc; }

/* Sous-éléments de la colonne nom */
.month-grid .cell-name .emp-avatar-col {
  display: flex; flex-direction: column;
  align-items: center; flex-shrink: 0; gap: 1px;
}
.month-grid .cell-name .emp-ab-under {
  font-size: .46rem; font-weight: 700; line-height: 1; white-space: nowrap;
}
.month-grid .cell-name .emp-name-col {
  display: flex; flex-direction: column;
  min-width: 0; flex: 1 1 0; gap: 1px; justify-content: center;
}
.month-grid .cell-name .emp-qual-row {
  display: flex; align-items: center; gap: 2px; min-width: 0; flex-wrap: wrap;
}
.month-grid .cell-name .emp-prenom {
  color: #1e293b; font-size: .76rem; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.month-grid .cell-name .emp-period-total {
  font-size: .59rem; font-weight: 700; color: #64748b; margin-top: 1px;
  white-space: nowrap;
}
.month-grid .cell-name .cell-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.month-grid .cell-name .cell-avatar-init {
  display: flex; align-items: center; justify-content: center;
  font-size: .56rem; font-weight: 700; color: #fff;
}
.month-grid .cell-name .emp-qual {
  font-size: .56rem; font-weight: 600;
  padding: 1px 3px; border-radius: 3px;
  text-transform: capitalize; flex-shrink: 0;
}

/* ── Séparateur de groupe qualification ── */
.month-grid .group-sep {
  grid-column: 1 / -1;
  background: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  border-bottom: 1px solid #e2e8f0;
  padding: .18rem .5rem;
  font-size: .6rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em;
  color: #94a3b8;
  display: flex; align-items: center; gap: .4rem;
  position: sticky; left: 0;
}
.month-grid .group-sep::before {
  content: '';
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; flex-shrink: 0;
  background: var(--gc, #94a3b8);
}

/* ── Cellules planning ── */
.month-grid .cell-day {
  cursor: pointer; position: relative; transition: filter .12s;
}
.month-grid .cell-day:hover { filter: brightness(.92); }
.month-grid .cell-day.weekend { background: #f7f8fa; }
.month-grid .cell-day.today   { outline: 2px solid var(--blue); outline-offset: -2px; }
.month-grid .cell-day.repos   { background: #f1f5f9 !important; }
.month-grid .cell-day.conge   { background: var(--amber-lt) !important; }
.month-grid .cell-day.garde   { background: var(--purple-lt) !important; }
.month-grid .cell-day.ferie   { background: #fef2f2 !important; }
/* Ligne paire : fond très légèrement plus sombre pour guider l'œil */
.month-grid .cell-day.row-even:not([class*="abs-"]):not(.today):not(.garde):not(.conge):not(.repos):not(.ferie) {
  filter: brightness(.975);
}

.cell-hours { font-size: .66rem; font-weight: 700; line-height: 1; }
/* Badge A/B */
.cell-ab {
  font-size: .52rem; font-weight: 800;
  position: absolute; top: 2px; left: 2px;
  border-radius: 3px; padding: 0 3px; line-height: 1.4;
}
.cell-ab-a { background: var(--green-lt); color: var(--green); }
.cell-ab-b { background: var(--gray-lt);  color: #475569; }

/* ── Vue Semaine ── */
.month-grid.view-week .cell       { min-height: 58px; flex-direction: column; justify-content: flex-start; align-items: flex-start; padding: .3rem .4rem; }
.month-grid.view-week .cell-name  { flex-direction: row; align-items: center; padding: .3rem .5rem; }
.month-grid.view-week .cell-header { height: 34px; }
.month-grid.view-week .cell-hours { font-size: .72rem; font-weight: 700; }

/* ── Vue Jour ── */
.month-grid.view-day .cell        { min-height: 76px; flex-direction: column; justify-content: flex-start; align-items: flex-start; padding: .55rem .7rem; }
.month-grid.view-day .cell-name   { min-height: 76px; flex-direction: row; align-items: flex-start; flex-wrap: wrap; }
.month-grid.view-day .cell-header { height: 42px; font-size: .8rem; }
.month-grid.view-day .cell-hours  { font-size: .82rem; font-weight: 700; margin-bottom: .12rem; }

/* ── Gradient fill heures partielles ── */
.cell-fill-normal { background: linear-gradient(to top, #86efac var(--pct,0%), #dcfce7 var(--pct,0%)); }
.cell-fill-garde  { background: linear-gradient(to top, #c4b5fd var(--pct,0%), #f3e8ff var(--pct,0%)); }

/* ============================================================
   PLANNING — VUE SEMAINE (timeline)
   ============================================================ */
.week-grid {
  display: grid;
  grid-template-columns: 150px repeat(7, 1fr);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.week-day-header {
  padding: .5rem; text-align: center;
  border-bottom: 2px solid #e2e8f0;
  font-size: .82rem; font-weight: 700;
}
.week-day-header.today-col { background: var(--blue-lt); color: var(--blue); }
.week-day-header.weekend-col { color: var(--gray); }
.week-row-label {
  padding: .4rem .6rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: .82rem; font-weight: 600;
  display: flex; flex-direction: column;
}
.week-row-label .qual-tag {
  font-size: .68rem; padding: .1rem .35rem;
  border-radius: 4px; margin-top: .2rem;
  display: inline-block;
}
.week-cell {
  border-left: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  position: relative; min-height: 52px;
  cursor: pointer;
}
.week-cell:hover { background: #f8fafc; }
.week-entry {
  position: absolute; left: 3px; right: 3px;
  border-radius: 6px;
  font-size: .72rem; padding: .2rem .35rem;
  overflow: hidden; line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.entry-normal { background: var(--green-lt); color: #14532d; border-left: 3px solid var(--green); }
.entry-garde  { background: var(--purple-lt); color: #581c87; border-left: 3px solid var(--purple); }
.entry-conge  { background: var(--amber-lt); color: #78350f; border-left: 3px solid var(--amber); }
.entry-repos  { background: var(--gray-lt); color: var(--gray); border-left: 3px solid #9ca3af; }
.entry-echange{ background: var(--blue-lt); color: #1e40af; border-left: 3px solid var(--blue); }

/* ============================================================
   PLANNING — VUE JOURNÉE (plein écran, no-scroll)
   ============================================================ */
.day-view {
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
}
.day-view-header {
  padding: .75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; gap: 1rem;
  flex-shrink: 0;
}
.day-view-body {
  flex: 1; overflow: hidden;
  display: flex;
}
.day-timeline {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.timeline-hour-line {
  position: absolute; left: 0; right: 0;
  height: 1px; background: #e2e8f0;
  font-size: .7rem; color: #94a3b8;
}
.timeline-hour-line::before {
  content: attr(data-h);
  position: absolute; left: 4px; top: -9px;
  font-size: .68rem; color: #94a3b8;
}
.day-person-col {
  width: 120px; border-right: 1px solid #e2e8f0;
  padding: .5rem; font-size: .8rem; font-weight: 600;
}

/* ============================================================
   MODE CONCEPTION (drag & drop)
   ============================================================ */
.conception-wrap { display: flex; gap: 1rem; height: 100%; }
.conception-sidebar {
  width: 240px; flex-shrink: 0;
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem;
  overflow-y: auto;
}
.conception-timeline {
  flex: 1; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.drag-entry {
  cursor: grab; user-select: none;
}
.drag-entry:active { cursor: grabbing; }
.drag-ghost {
  opacity: .5; border: 2px dashed var(--blue);
}

/* Poignée de redimensionnement */
.resize-handle {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 6px; cursor: ns-resize;
  background: rgba(0,0,0,.1); border-radius: 0 0 4px 4px;
}

/* ============================================================
   CONGÉS
   ============================================================ */
.vac-cycle-bar {
  background: var(--blue-lt); border-radius: 8px;
  padding: .75rem 1rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .75rem; font-size: .9rem;
}
.vac-progress {
  flex: 1; height: 10px; background: #e2e8f0;
  border-radius: 5px; overflow: hidden;
}
.vac-progress-bar {
  height: 100%; background: var(--blue); border-radius: 5px;
  transition: width .3s;
}

/* ============================================================
   SUPERADMIN
   ============================================================ */
.sa-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.sa-stat {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.sa-stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.sa-stat-val { font-size: 1.8rem; font-weight: 800; color: #1e293b; }
.sa-stat-lbl { font-size: .82rem; color: var(--gray); }

/* Barre de supervision (superadmin dans une pharmacie) */
.sa-pharma-bar {
  background: linear-gradient(90deg,#6d28d9,#7c3aed);
  color: #fff; padding: .5rem 1.5rem;
  display: flex; align-items: center; gap: .85rem;
  font-size: .83rem; position: sticky; top: 0; z-index: 300;
}
.sa-pharma-bar strong { flex: 1; }
.sa-pharma-bar .btn-sa-exit {
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  padding: .28rem .85rem; border-radius: 6px;
  font-size: .8rem; text-decoration: none; cursor: pointer;
  transition: background .15s;
}
.sa-pharma-bar .btn-sa-exit:hover { background: rgba(255,255,255,.28); }

/* Grille de cartes pharmacie */
.sa-pharma-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px,1fr));
  gap: 1rem; margin-top: 1rem;
}
.sa-pharma-card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid #e5e7eb;
  display: flex; flex-direction: column;
  transition: box-shadow .18s, transform .18s;
}
.sa-pharma-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-1px); }
.sa-pharma-card-head {
  padding: 1rem 1.1rem .7rem;
  display: flex; align-items: flex-start; gap: .7rem;
  border-bottom: 1px solid #f1f5f9;
}
.sa-pharma-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: #f0f9ff; display: flex; align-items: center;
  justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.sa-pharma-card-title { font-weight: 700; font-size: .95rem; color: #1e293b; }
.sa-pharma-card-slug  { font-size: .75rem; color: #94a3b8; font-family: monospace; }
.sa-pharma-card-body {
  padding: .7rem 1.1rem; flex: 1;
  font-size: .82rem; color: #475569;
  display: flex; flex-direction: column; gap: .3rem;
}
.sa-pharma-card-body .row {
  display: flex; align-items: center; gap: .4rem;
}
.sa-pharma-card-foot {
  padding: .7rem 1.1rem;
  border-top: 1px solid #f1f5f9;
  display: flex; gap: .4rem; flex-wrap: wrap; align-items: center;
}
/* Carte inactive */
.sa-pharma-card.inactive { opacity: .65; }
.sa-pharma-card.inactive .sa-pharma-card-icon { background: #fef2f2; }

/* Dashboard recent log */
.sa-log-row {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .5rem .75rem; border-radius: 6px;
  font-size: .82rem; color: #374151;
}
.sa-log-row:hover { background: #f8fafc; }
.sa-log-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: .35rem;
}

/* ============================================================
   ÉCHANGES
   ============================================================ */
.exchange-card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem;
  border-left: 4px solid var(--blue);
  margin-bottom: .75rem;
}
.exchange-card.pending { border-color: var(--amber); }
.exchange-card.accepted{ border-color: var(--green); }
.exchange-card.refused { border-color: var(--red); }

/* ============================================================
   PAGE CONNEXION
   ============================================================ */
.login-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  padding: 1.5rem;
}
.login-card {
  background: #fff; border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  width: 100%; max-width: 420px; padding: 2.5rem;
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-icon {
  width: 64px; height: 64px; margin: 0 auto .75rem;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.login-logo h1 { font-size: 1.6rem; font-weight: 800; color: #1e293b; }
.login-logo p { color: var(--gray); font-size: .9rem; margin-top: .25rem; }

/* ============================================================
   PAGE D'ACCUEIL COMMERCIALE
   ============================================================ */
.home-hero {
  min-height: 100vh;
  background: linear-gradient(160deg, #1e3a8a 0%, #4c1d95 100%);
  color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 3rem 2rem;
}
.home-hero h1 { font-size: clamp(2rem,5vw,3.5rem); font-weight: 900; margin-bottom: 1rem; }
.home-hero p { font-size: 1.2rem; opacity: .85; max-width: 600px; margin: 0 auto 2rem; }
.home-cta { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.home-cta a {
  padding: .85rem 2rem; border-radius: 10px; font-weight: 700;
  font-size: 1rem; text-decoration: none; transition: transform .2s;
}
.home-cta a:hover { transform: translateY(-2px); }
.cta-primary { background: #fff; color: var(--blue); }
.cta-secondary { background: rgba(255,255,255,.15); color: #fff; border: 2px solid rgba(255,255,255,.4); }

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

/* ── Animation swipe-hint (clignotement léger sur les boutons ◀▶) ── */
@keyframes swipe-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .7; transform: scale(.94); }
}
.swipe-hint { animation: swipe-pulse .9s ease-in-out infinite; }

/* ── 900 px : tablette paysage / petit laptop ─────────────── */
@media (max-width: 900px) {
  .app-header { padding: 0 .75rem; gap: .5rem; }
  .app-header .app-pharma-name { display: none; }

  /* Onglets : barre scrollable, libellés cachés (icône seule) */
  .app-tabs {
    padding: 0 .4rem;
    overflow-x: auto; overflow-y: visible;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .app-tabs::-webkit-scrollbar { display: none; }
  .app-tab { padding: 0 .65rem; font-size: .85rem; flex-shrink: 0; }
  .app-tab span:not(.icon):not(.caret) { display: none; }
  .app-menu-btn { padding: 0 .65rem; font-size: .85rem; flex-shrink: 0; }
  .app-menu-btn span:not(.icon):not(.caret) { display: none; }

  /* Switcher Mois/Semaine/Jour : plus compact */
  .view-switch .view-btn { padding: .38rem .6rem; font-size: .78rem; }

  /* Planning nav : supprimer la colonne date courante */
  .planning-nav { grid-template-columns: auto 1fr auto; }
  .planning-nav > div:first-child { display: none; }
}

/* ── 768 px : tablette portrait / grand téléphone ────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .app-sidebar { display: none; }

  /* Contenu principal : padding réduit */
  .app-content { padding: .75rem .65rem; }

  /* Planning nav : empilé verticalement */
  .planning-nav {
    display: flex; flex-direction: column;
    align-items: center; gap: .45rem;
    margin-bottom: .6rem;
  }
  .planning-nav > div:first-child { display: none; }    /* masque date courante */
  .planning-nav > div:nth-child(2) { order: 1; width: 100%; justify-content: center; }
  .planning-nav > div:last-child  { order: 2; width: 100%; justify-content: center; flex-wrap: wrap; }

  /* Boutons ◀ ▶ : zone de tap généreuse */
  .planning-nav .btn-sm { min-height: 40px; min-width: 40px; padding: 0 .85rem; }
  #planning-title { font-size: 1rem; min-width: 0; }

  /* Switcher de vue : visible mais compact */
  .view-switch { }
  .view-switch .view-btn { padding: .38rem .6rem; font-size: .78rem; }

  /* Vue MOIS : colonnes serrées */
  .month-grid.view-month {
    grid-template-columns: 78px repeat(31, minmax(13px, 1fr)) !important;
    font-size: .68rem;
  }
  /* Vue SEMAINE : colonnes réduites (175px → 110px pour le nom) */
  .month-grid.view-week {
    grid-template-columns: 110px repeat(7, minmax(54px, 1fr)) !important;
  }
  .month-grid .cell { min-height: 28px; }
  .month-grid .cell-name { padding: .15rem .2rem; gap: .2rem; }
  .month-grid .cell-name .emp-qual-row { display: none; }
  .month-grid .cell-name .emp-period-total { display: none; }
  .month-grid .cell-name .emp-prenom { font-size: .7rem; }
  .month-grid .cell-header { height: 28px; font-size: .65rem; }

  /* Modales : bottom-sheet plein largeur */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal-header { padding: 1rem 1.25rem .85rem; }
  .modal-body   { padding: 1.1rem 1.25rem; }
  .modal-footer { padding: .85rem 1.25rem; }

  /* Cartes : padding réduit */
  .card { padding: .85rem .9rem; }

  /* Tables : font réduite */
  th, td { padding: .45rem .6rem; font-size: .82rem; }

  /* Stats : grille 2 colonnes KPI */
  .stats-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .stats-kpi { padding: .7rem .85rem; }
  .stats-kpi-value { font-size: 1.5rem; }

  /* Légende planning : compactée */
  .planning-legend { gap: .85rem; font-size: .72rem; }

  /* Boutons inline : taille touch correcte */
  .btn { min-height: 38px; }
  .btn-sm { min-height: 34px; padding: .3rem .7rem; }
}

/* ── 480 px : téléphone portrait ────────────────────────────── */
@media (max-width: 480px) {
  /* Header : ultra-compact */
  .app-header { height: 46px; padding: 0 .5rem; gap: .35rem; }
  .app-logo { font-size: .92rem; gap: .35rem; }
  .app-logo-icon { width: 28px; height: 28px; font-size: .9rem; }

  /* Masquer le texte "PlaniPharma" dans le logo */
  .app-logo > span:not(.app-logo-icon) { display: none; }

  /* Contenu : padding minimal */
  .app-content { padding: .5rem .35rem; }

  /* Planning nav : plus compact */
  #planning-title { font-size: .9rem; }
  .planning-nav .btn-sm { min-height: 38px; min-width: 38px; padding: 0 .6rem; font-size: .85rem; }

  /* Vue MOIS : maximum compaction */
  .month-grid.view-month {
    grid-template-columns: 52px repeat(31, minmax(10.5px, 1fr)) !important;
    font-size: .6rem;
    gap: 0.5px;
  }
  /* Vue SEMAINE : colonnes adaptées au téléphone — scroll léger accepté */
  .month-grid.view-week {
    grid-template-columns: 80px repeat(7, minmax(42px, 1fr)) !important;
    font-size: .72rem;
  }
  .month-grid.view-week .cell { min-height: 52px; }

  .month-grid .cell { min-height: 24px; padding: 1px 1px; }
  .month-grid .cell-header { height: 26px; font-size: .6rem; }
  .month-grid .cell-name { padding: .1rem .1rem; gap: .1rem; }
  .month-grid.view-month .cell-name .emp-avatar-col { display: none; }
  .month-grid.view-month .cell-name .emp-prenom {
    font-size: .6rem; white-space: normal; word-break: break-all; line-height: 1.1;
  }

  /* Boutons header : icône seule */
  .app-header .btn { font-size: 0; padding: 0; width: 36px; height: 36px; border-radius: 8px; }
  .app-header .btn::first-letter { font-size: 1rem; }

  /* Stats KPI : 1 colonne sur très petits écrans */
  .stats-kpi-grid { grid-template-columns: 1fr 1fr; }

  /* Overtime panel : compact */
  #overtime-panel { font-size: .78rem; }
  #overtime-panel table { font-size: .75rem; }
  #overtime-panel th,
  #overtime-panel td { padding: .3rem .4rem; }

  /* Modales : max-height plus généreux */
  .modal { max-height: 95vh; }
  .modal-body .form-group { margin-bottom: .7rem; }

  /* Cartes */
  .card { padding: .65rem .7rem; border-radius: 8px; }

  /* Formulaire édition journée : champs horaires sur 1 colonne */
  #time-fields > div[style] { display: flex !important; flex-direction: column; gap: .45rem !important; }
}

/* ================================================================
   MOBILE — Améliorations responsives (Lots 1, 2 et 3)
   ================================================================ */

/* ──────────────────────────────────────────────────────────────
   LOT 1 — Formulaires 2 colonnes → 1 colonne, dropdowns, touch
   ────────────────────────────────────────────────────────────── */

/* Classe utilitaire : grille 2 col qui se replie en 1 col sur mobile */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 600px) {
  .form-row-2 {
    grid-template-columns: 1fr !important;
    gap: .5rem !important;
  }
}

/* Dropdown tabs : bottom-sheet sur mobile (évite la sortie du viewport) */
@media (max-width: 600px) {
  /* Le panel sort en bas plutôt qu'en bas du bouton */
  .app-menu-panel {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    border-radius: 14px 14px 0 0 !important;
    box-shadow: 0 -4px 24px rgba(0,0,0,.18) !important;
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom, .5rem);
  }
  /* Overlay sombre derrière le panel */
  .app-menu.open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 29;
  }
}

/* Touch targets : poignées de redimensionnement de la timeline (≥ 44px) */
@media (max-width: 768px) {
  .tl2-resize-left,
  .tl2-resize-right {
    width: 18px;
  }
  /* Barre : hauteur minimale pour le toucher */
  .tl2-bar { min-height: 30px; }
}

/* ──────────────────────────────────────────────────────────────
   LOT 2 — Planning mensuel lisible sur smartphone
   ────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  /* Scroll horizontal avec indicateur de débordement */
  .month-grid-scroll {
    -webkit-overflow-scrolling: touch;
    /* Indicateur de shadow aux bords (scroll shadows trick) */
    background:
      linear-gradient(to right, #fff 4px, transparent 40px),
      linear-gradient(to left,  #fff 4px, transparent 40px) 100% 0,
      radial-gradient(farthest-side at 0   50%, rgba(0,0,0,.08), transparent),
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.08), transparent) 100% 0;
    background-color: #fff;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 12px 100%, 12px 100%;
    background-attachment: local, local, scroll, scroll;
  }

  /* Vue MOIS : colonne nom ultra-étroite — juste l'avatar/initiales */
  .month-grid.view-month {
    grid-template-columns: 34px repeat(31, minmax(9px, 1fr)) !important;
    font-size: .58rem;
    min-width: 300px;
  }

  /* Cellule nom : centrer, ne montrer que l'avatar/initiales (vue mois uniquement) */
  .month-grid.view-month .cell-name {
    padding: 0 1px !important;
    gap: 0 !important;
    justify-content: center;
    flex-direction: column;
    align-items: center;
  }
  /* Vue MOIS — masquer le texte, ne garder que l'avatar */
  .month-grid.view-month .cell-name .emp-name-col { display: none !important; }
  /* Rétablir l'avatar dans la vue mois (masqué par le bloc 480px existant) */
  .month-grid.view-month .cell-name .emp-avatar-col {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  .month-grid.view-month .cell-name .emp-ab-under { display: none !important; }
  .month-grid.view-month .cell-name .cell-avatar,
  .month-grid.view-month .cell-name .cell-avatar-init {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    font-size: .55rem !important;
    line-height: 22px !important;
    border-radius: 50% !important;
  }

  /* En-têtes jours (toutes vues) */
  .month-grid .cell-header { font-size: .57rem; white-space: pre; line-height: 1.2; height: 24px; }

  /* Cellules planning vue mois : ultra-compactes */
  .month-grid.view-month .cell { min-height: 20px; padding: 1px 0; }

  /* Vue SEMAINE à 480px : cellule nom normale (pas avatar seul) */
  .month-grid.view-week .cell-name { padding: .1rem .25rem !important; }
  .month-grid.view-week .cell-name .emp-avatar-col { display: none; }
  .month-grid.view-week .cell-name .emp-prenom {
    font-size: .65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
}

/* ──────────────────────────────────────────────────────────────
   LOT 3 — Timeline / Conception : adaptations mobiles
   ────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  /* Toolbar Conception : empile verticalement (override inline style) */
  #conception-toolbar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: .5rem !important;
  }
  /* Le bloc "Propager" prend toute la largeur */
  .propagate-info { width: 100%; box-sizing: border-box; }
  /* L'espace flexible n'a plus de sens en colonne */
  #conception-toolbar > div[style*="flex:1"] { display: none; }
}

@media (max-width: 768px) {
  /* Colonne jour dans le Gantt : plus étroite */
  .tl2-day-col {
    width: 58px !important;
    min-width: 58px !important;
    font-size: .7rem;
    padding: .3rem .35rem;
  }
  /* Grille : min-width réduit pour que le scroll soit moins pénible */
  .tl2-grid { min-width: 480px; }

  /* Palette employés : chips plus petites */
  .tl2-chip { padding: .28rem .65rem; font-size: .78rem; }

  /* Barre d'aide : masquer le texte long sur mobile */
  #tl2-hint-bar > span:nth-child(2) { display: none; }
}

@media (max-width: 480px) {
  .tl2-day-col {
    width: 44px !important;
    min-width: 44px !important;
    font-size: .62rem;
    padding: .25rem .25rem;
  }
  .tl2-grid { min-width: 340px; }
  .tl2-ruler-lbl { font-size: .5rem; }
  /* Palette : wrap horizontal scrollable */
  .tl2-palette {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tl2-palette::-webkit-scrollbar { display: none; }
  .tl2-palette-label { display: none; } /* gain de place */
}
