/* ============================================================
   MTC Planning App — Feuille de style principale
   Stack : Tailwind (utilitaires) + CSS custom (composants)
   ============================================================ */

/* ─── Variables ──────────────────────────────────────────────── */
:root {
  --coffee:       #6F4E37;
  --coffee-light: #A0785A;
  --coffee-dark:  #4A3020;
  --sidebar-w:    240px;
  --topbar-h:     56px;
  --radius:       0.75rem;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

/* ─── Reset minimal ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; margin: 0; }

/* ============================================================
   LAYOUT — Sidebar + Main
   ============================================================ */

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: #1C1512;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform .25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo-icon  { font-size: 1.75rem; }
.logo-text  { font-size: 1rem; font-weight: 700; color: #fff; letter-spacing: -.01em; }

/* Nav items */
.sidebar-nav  { flex: 1; padding: .75rem .75rem; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .875rem;
  border-radius: .5rem;
  color: rgba(255,255,255,.6);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
  margin-bottom: .1rem;
}
.nav-item:hover        { background: rgba(255,255,255,.07); color: #fff; }
.nav-item-active       { background: var(--coffee); color: #fff !important; }
.nav-item-active:hover { background: var(--coffee-light); }
.nav-icon              { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }

/* Utilisateur bas sidebar */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
}
.user-avatar {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-info   { flex: 1; min-width: 0; }
.user-name   { font-size: .8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role   { font-size: .7rem; color: rgba(255,255,255,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn  { color: rgba(255,255,255,.4); padding: .25rem; border-radius: .375rem; transition: color .15s; }
.logout-btn:hover { color: #ff6b6b; }
.logout-btn svg { width: 1rem; height: 1rem; }

/* Overlay mobile */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 40;
}
.overlay.active { display: block; }

/* Main wrapper */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #F0EDE8;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
}
.menu-btn   { display: none; background: none; border: none; cursor: pointer; color: #6B7280; padding: .25rem; }
.menu-btn svg { width: 1.375rem; height: 1.375rem; }
.topbar-title { font-size: 1rem; font-weight: 600; color: #111; flex: 1; }
.topbar-right { margin-left: auto; }

/* Page content */
.page-content { flex: 1; padding: 1.5rem; width: 100%; }

/* ─── Responsive mobile ──────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar        { transform: translateX(-100%); }
  .sidebar.open   { transform: translateX(0); }
  .main-wrapper   { margin-left: 0; }
  .menu-btn       { display: flex; align-items: center; }
  .page-content   { padding: 1rem; }
}

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

/* ─── Card ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #F0EDE8;
  padding: 1.25rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title { font-size: 1rem; font-weight: 600; color: #1a1a1a; }
.btn-link   { font-size: .8rem; color: var(--coffee); text-decoration: none; }
.btn-link:hover { text-decoration: underline; }

/* ─── KPI Cards ─────────────────────────────────────────────── */
.kpi-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid #F0EDE8;
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow .15s;
}
.kpi-card:hover     { box-shadow: var(--shadow-md); }
.kpi-card-alert     { border-color: #FCA5A5; background: #FFF5F5; }
.kpi-card-warn      { border-color: #FDE68A; background: #FFFBEB; }
.kpi-icon           { width: 2.75rem; height: 2.75rem; border-radius: .625rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-value          { font-size: 1.75rem; font-weight: 700; color: #111; line-height: 1; }
.kpi-label          { font-size: .75rem; color: #9CA3AF; margin-top: .15rem; }

/* ─── Tableau ───────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table thead tr { border-bottom: 2px solid #F5F0EB; }
.table th {
  padding: .625rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.table td {
  padding: .75rem 1rem;
  font-size: .875rem;
  color: #374151;
  border-bottom: 1px solid #F9F6F3;
}
.table tbody tr:hover { background: #FDFBF9; }
.table tbody tr:last-child td { border-bottom: none; }
.row-alert  { background: #FFF5F5 !important; }
.row-warn   { background: #FFFDF0 !important; }

/* ─── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 9999px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-blue   { background: #DBEAFE; color: #1E40AF; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-gray   { background: #F3F4F6; color: #6B7280; }
.badge-purple { background: #EDE9FE; color: #5B21B6; }

/* ─── Avatars ───────────────────────────────────────────────── */
.avatar-sm {
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

/* ─── Inputs ────────────────────────────────────────────────── */
.input-field {
  border: 1px solid #E5E0DA;
  border-radius: .5rem;
  padding: .5rem .75rem;
  font-size: .875rem;
  color: #1a1a1a;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.input-field:focus {
  border-color: var(--coffee);
  box-shadow: 0 0 0 3px rgba(111,78,55,.12);
}
.input-field::placeholder { color: #C4B9B0; }
.label { display: block; font-size: .8rem; font-weight: 500; color: #374151; margin-bottom: .375rem; }

/* ─── Boutons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-size: .875rem; font-weight: 500;
  padding: .5rem 1rem;
  border-radius: .5rem;
  border: none; cursor: pointer;
  transition: background .15s, box-shadow .15s, opacity .15s;
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm       { padding: .375rem .75rem; font-size: .8rem; }
.btn-primary  { background: var(--coffee); color: #fff; }
.btn-primary:hover { background: var(--coffee-dark); }
.btn-outline  { background: transparent; color: #374151; border: 1px solid #D1CBC4; }
.btn-outline:hover { background: #F9F6F3; }
.btn-ghost    { background: transparent; color: #374151; }
.btn-ghost:hover { background: #F3F0EC; }
.btn-danger   { background: #FEE2E2; color: #991B1B; }
.btn-danger:hover { background: #FCA5A5; }

/* ─── Empty state ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9CA3AF;
}

/* ─── Stock qty colors ──────────────────────────────────────── */
.stock-qty-stock-ok    { color: #059669; }
.stock-qty-stock-low   { color: #D97706; }
.stock-qty-stock-empty { color: #DC2626; }

/* ============================================================
   PLANNING — Grille hebdomadaire
   ============================================================ */

.planning-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 400px;
}

/* En-tête jours */
.planning-day-header {
  padding: .625rem .5rem;
  text-align: center;
  border-right: 1px solid #F0EDE8;
  border-bottom: 2px solid #F0EDE8;
  background: #FAFAF9;
}
.planning-day-header:last-child { border-right: none; }
.planning-day-header.today      { background: #FFF7F0; }
.day-name   { font-size: .7rem; font-weight: 600; color: #9CA3AF; text-transform: uppercase; letter-spacing: .08em; }
.day-number { font-size: 1.25rem; font-weight: 700; color: #374151; margin-top: .125rem; }
.today-circle {
  background: var(--coffee);
  color: #fff !important;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* Cellules planning */
.planning-day-cell {
  padding: .5rem;
  border-right: 1px solid #F0EDE8;
  min-height: 120px;
  vertical-align: top;
  position: relative;
}
.planning-day-cell:last-child { border-right: none; }
.planning-day-cell:hover { background: #FDFBF9; }

/* Blocs de shifts */
.shift-block {
  background: #fff;
  border: 1px solid #E5E0DA;
  border-left: 3px solid var(--coffee);
  border-radius: .375rem;
  padding: .375rem .5rem;
  margin-bottom: .375rem;
  cursor: pointer;
  transition: box-shadow .15s, opacity .15s;
  font-size: .78rem;
  position: relative;
}
.shift-block:hover { box-shadow: var(--shadow-md); }

/* ─── Boutons d'action sur le créneau (hover) ───────────────── */
.shift-actions {
  position: absolute;
  top: 3px;
  right: 3px;
  display: none;
  gap: 2px;
  z-index: 10;
}
.shift-block:hover .shift-actions { display: flex; }
.shift-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: rgba(255,255,255,.92);
  border: 1px solid #e5e7eb;
  border-radius: 3px;
  font-size: 10px;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
  padding: 0;
  transition: background .1s, color .1s;
}
.shift-action-btn:hover       { background: #f3f4f6; color: #1f2937; }
.shift-action-delete:hover    { background: #fee2e2 !important; color: #dc2626 !important; border-color: #fca5a5; }
.shift-action-duplicate:hover { background: #eff6ff !important; color: #2563eb !important; border-color: #93c5fd; }

/* ─── Drag & drop ─────────────────────────────────────────────── */
.shift-block[draggable="true"] { cursor: grab; }
.shift-block[draggable="true"]:active { cursor: grabbing; }
.shift-block.dragging { opacity: .35; box-shadow: none; }
.planning-day-cell.drag-over {
  background: #fef3c7 !important;
  outline: 2px dashed #f59e0b;
  outline-offset: -2px;
}
.planning-day-cell.drag-over .add-shift-btn { opacity: 0; pointer-events: none; }
.shift-time   { font-weight: 600; color: #374151; font-size: .72rem; }
.shift-name   { color: #6B7280; margin-top: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-status { margin-top: .25rem; font-size: .65rem; }

/* Bouton + ajouter créneau */
.add-shift-btn {
  width: 100%;
  padding: .25rem;
  border: 1px dashed #D1CBC4;
  border-radius: .375rem;
  background: none;
  color: #C4B9B0;
  cursor: pointer;
  font-size: 1rem;
  transition: background .15s, color .15s;
  margin-top: .25rem;
}
.add-shift-btn:hover { background: #F3F0EC; color: var(--coffee); border-color: var(--coffee); }

/* Responsive planning */
@media (max-width: 640px) {
  .planning-grid { grid-template-columns: repeat(7, minmax(80px, 1fr)); overflow-x: auto; }
  .shift-block   { min-width: 72px; }
}

/* ============================================================
   EMPLOYEES — Grille
   ============================================================ */
.employee-card {
  background: #fff;
  border: 1px solid #F0EDE8;
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .5rem;
  box-shadow: var(--shadow);
  transition: box-shadow .15s;
}
.employee-card:hover { box-shadow: var(--shadow-md); }
.employee-avatar {
  width: 3.5rem; height: 3.5rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700; color: #fff;
}
.employee-name   { font-size: .9rem; font-weight: 600; color: #111; }
.employee-role   { font-size: .78rem; color: #9CA3AF; }
.employee-coffee { font-size: .72rem; }

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
}
.modal-box {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  animation: modal-in .2s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-1rem) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-title { font-size: 1.1rem; font-weight: 700; color: #111; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: #9CA3AF; padding: .25rem;
  border-radius: .375rem; transition: background .15s;
}
.modal-close:hover { background: #F3F4F6; color: #374151; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.toast {
  background: #1C1512;
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: .625rem;
  font-size: .875rem;
  max-width: 320px;
  display: flex; align-items: center; gap: .625rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  animation: toast-in .25s ease;
}
.toast.success::before { content: '✓'; color: #34D399; font-weight: 700; }
.toast.error::before   { content: '✗'; color: #F87171; font-weight: 700; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(.5rem); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   PLANNING — Toolbar & filtres
   ============================================================ */
.planning-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.view-toggle {
  display: flex;
  background: #F3F0EC;
  border-radius: .5rem;
  padding: .2rem;
  gap: .15rem;
}
.view-btn {
  padding: .35rem .875rem;
  border-radius: .375rem;
  font-size: .8rem;
  font-weight: 500;
  color: #6B7280;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.view-btn:hover    { background: #E8E3DC; color: #374151; }
.view-btn-active   { background: #fff; color: var(--coffee); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.period-label      { font-weight: 600; color: #374151; font-size: .9rem; min-width: 180px; text-align: center; }

.planning-filters  { display: flex; flex-wrap: wrap; align-items: center; gap: .625rem; margin-left: auto; }
.filter-group      { display: flex; align-items: center; gap: .375rem; }
.filter-label      { display: flex; align-items: center; gap: .25rem; font-size: .75rem; color: #9CA3AF; font-weight: 500; white-space: nowrap; }
.filter-select     { border: 1px solid #E5E0DA; border-radius: .5rem; padding: .375rem .625rem; font-size: .8rem; color: #374151; background: #fff; outline: none; cursor: pointer; }
.filter-select:focus { border-color: var(--coffee); box-shadow: 0 0 0 2px rgba(111,78,55,.1); }

/* Légende */
.planning-legend   { display: flex; flex-wrap: wrap; gap: .625rem; padding: .75rem 1rem; border-bottom: 1px solid #F0EDE8; background: #FDFBF9; }
.legend-item       { display: flex; align-items: center; gap: .375rem; font-size: .75rem; color: #6B7280; }
.legend-dot        { width: .625rem; height: .625rem; border-radius: 50%; flex-shrink: 0; }

/* Shift amélioré */
.shift-person      { display: flex; align-items: center; gap: .3rem; font-size: .78rem; color: #374151; margin-top: .15rem; }
.shift-dot         { width: .5rem; height: .5rem; border-radius: 50%; flex-shrink: 0; }
.shift-location    { display: flex; align-items: center; gap: .3rem; font-size: .7rem; color: #9CA3AF; margin-top: .1rem; }
.shift-loc-dot     { width: .45rem; height: .45rem; border-radius: 50%; flex-shrink: 0; }
.day-count         { font-size: .65rem; color: #C4B9B0; margin-top: .1rem; }

/* ============================================================
   PLANNING — Vue mensuelle
   ============================================================ */
.monthly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

/* En-tête jours */
.monthly-header {
  padding: .5rem;
  text-align: center;
  font-size: .7rem;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 2px solid #F0EDE8;
  background: #FAFAF9;
}

/* Cellule jour */
.monthly-cell {
  min-height: 100px;
  padding: .375rem .375rem .5rem;
  border-right: 1px solid #F0EDE8;
  border-bottom: 1px solid #F0EDE8;
  position: relative;
  transition: background .1s;
}
.monthly-cell:nth-child(7n) { border-right: none; }
.monthly-cell:hover          { background: #FDFBF9; }
.monthly-cell-empty          { background: #FAFAF9; opacity: .5; }
.monthly-cell-weekend        { background: #FDFCF8; }
.monthly-cell-today          { background: #FFF8F3 !important; }
.monthly-cell-today .monthly-day-num { background: var(--coffee); color: #fff !important; }

/* Numéro du jour */
.monthly-day-num {
  font-size: .8rem;
  font-weight: 600;
  color: #374151;
  width: 1.5rem; height: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  margin-bottom: .25rem;
  line-height: 1;
}

/* Shifts dans la cellule */
.monthly-shifts     { display: flex; flex-direction: column; gap: .2rem; }
.monthly-shift-item {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .375rem;
  border-radius: .25rem;
  font-size: .7rem;
  cursor: pointer;
  transition: opacity .1s;
  overflow: hidden;
}
.monthly-shift-item:hover  { opacity: .8; }
.monthly-shift-time        { font-weight: 600; color: #374151; flex-shrink: 0; }
.monthly-shift-name        { color: #6B7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.monthly-shift-loc         { width: .5rem; height: .5rem; border-radius: 50%; flex-shrink: 0; }

/* Bouton "X autres" */
.monthly-more-btn {
  font-size: .68rem;
  color: var(--coffee);
  background: none;
  border: none;
  cursor: pointer;
  padding: .1rem .25rem;
  text-align: left;
  font-weight: 500;
}
.monthly-more-btn:hover { text-decoration: underline; }

/* Bouton + ajouter (vue mois) */
.monthly-add-btn {
  position: absolute;
  top: .25rem; right: .25rem;
  width: 1.25rem; height: 1.25rem;
  background: none;
  border: 1px dashed #D1CBC4;
  border-radius: .25rem;
  color: #C4B9B0;
  cursor: pointer;
  font-size: .75rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s;
  line-height: 1;
}
.monthly-cell:hover .monthly-add-btn { opacity: 1; }
.monthly-add-btn:hover { background: #F3F0EC; color: var(--coffee); border-color: var(--coffee); }

/* ============================================================
   PANNEAU DÉTAIL DU JOUR (slide-in lateral)
   ============================================================ */
.day-detail-panel {
  position: fixed;
  top: 0; right: 0;
  width: 320px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,.1);
  z-index: 60;
  padding: 1.5rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.day-detail-panel.open   { transform: translateX(0); }
.day-detail-panel.hidden { display: none; }
.day-detail-header       { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.day-detail-shift {
  background: #FDFBF9;
  border: 1px solid #F0EDE8;
  border-left: 3px solid transparent;
  border-radius: .5rem;
  padding: .625rem .75rem;
  transition: box-shadow .15s;
}
.day-detail-shift:hover { box-shadow: var(--shadow-md); }

@media (max-width: 640px) {
  .day-detail-panel { width: 100vw; }
  .planning-toolbar { gap: .5rem; }
  .filter-group     { flex-wrap: wrap; }
  .monthly-cell     { min-height: 60px; }
  .monthly-shift-time { display: none; }
}


/* ============================================================
   MODULE P&L — Style Google Sheets
   ============================================================ */

:root {
  --pnl-font:       Arial, 'Helvetica Neue', sans-serif;
  --pnl-navy:       #0f172a;
  --pnl-navy2:      #1e293b;
  --pnl-muted:      #64748b;
  --pnl-border:     #e2e8f0;
  --gs-border:      #e0e0e0;
  --gs-header-bg:   #f8f9fa;
  --gs-header-txt:  #444746;
  --gs-sec-bg:      #f1f3f4;
  --gs-hover:       #e8f0fe;
  --gs-select:      #1a73e8;
  --gs-bgt-bg:      #fafbff;
  --gs-bgt-hd:      #e8eaf6;
  --gs-bgt-txt:     #3949ab;
  --gs-rel-bg:      #fafffe;
  --gs-rel-hd:      #e8f5e9;
  --gs-rel-txt:     #2e7d32;
  --gs-cur-hd:      #1a73e8;
  --gs-total-bg:    #f8f9fa;
  --pnl-label-w:    210px;
  --pnl-col-w:      92px;
}

/* ── Page ─────────────────────────────────────────────────── */
.pnl-page {
  display: flex;
  flex-direction: column;
  background: #fff;
  font-family: var(--pnl-font);
  min-height: 0;
}

/* ── Toolbar ──────────────────────────────────────────────── */
.pnl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .5rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--gs-border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.pnl-tabs { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.pnl-tab {
  display: flex; align-items: center; gap: .3rem;
  padding: .35rem .8rem;
  border-radius: 9999px;
  font-size: .8125rem; font-weight: 500;
  color: #5f6368;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all .15s;
}
.pnl-tab:hover { background: #f1f3f4; color: #202124; }
.pnl-tab.active { background: #1a73e8; color: #fff; }
.tab-dot { width: .4rem; height: .4rem; border-radius: 50%; flex-shrink: 0; }

.pnl-controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Boutons export P&L */
.pnl-export-btns { display: flex; gap: .35rem; }
.btn-export {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .6rem; border-radius: .375rem;
  font-size: .75rem; font-weight: 500; color: #475569;
  background: #f1f5f9; border: 1.5px solid #e2e8f0;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-export:hover { background: #fff; border-color: #6F4E37; color: #6F4E37; }
.btn-export svg { width: .875rem; height: .875rem; }
.pnl-year-nav {
  display: flex; align-items: center;
  background: #f1f3f4; border-radius: .375rem; padding: .2rem .3rem; gap: .1rem;
}
.year-nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: .25rem;
  color: #5f6368; text-decoration: none; cursor: pointer; transition: background .12s;
}
.year-nav-btn:hover:not(.disabled) { background: #e2e8f0; }
.year-nav-btn.disabled { opacity: .3; pointer-events: none; }
.year-label { font-size: .875rem; font-weight: 600; color: #202124; padding: 0 .5rem; min-width: 3rem; text-align: center; }

/* ── KPI bar ──────────────────────────────────────────────── */
.pnl-kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  padding: .75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid var(--gs-border);
}
.kpi-card {
  background: #fff;
  border: 1px solid var(--gs-border);
  border-radius: .5rem;
  padding: .625rem .875rem;
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--kpi-accent, #1a73e8); border-radius: 0 2px 2px 0;
}
.kpi-label { font-size: .625rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #80868b; margin-bottom: .2rem; }
.kpi-amount { font-size: 1.125rem; font-weight: 700; color: #202124; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-amount.neg { color: #d93025; }
.kpi-sub { font-size: .6875rem; color: #80868b; margin-top: .15rem; display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: .15rem; padding: .1rem .35rem; border-radius: 9999px; font-size: .625rem; font-weight: 700; white-space: nowrap; }
.badge-pos { background: #e6f4ea; color: #137333; }
.badge-neg { background: #fce8e6; color: #c5221f; }
.badge-neu { background: #f1f3f4; color: #5f6368; }

/* ── Graphique ── FIX : conteneur à hauteur fixe ─────────── */
.pnl-chart-zone {
  background: #fff;
  border-bottom: 1px solid var(--gs-border);
  padding: .75rem 1rem .875rem;
}
/* Layout sidebar gauche + zone graphique droite */
.pnl-chart-inner {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.pnl-chart-sidebar {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  min-width: 90px;
  flex-shrink: 0;
  padding-top: 1.5rem;   /* alignement avec le graphique */
}
.chart-kpi-item  { display: flex; flex-direction: column; gap: .1rem; }
.chart-kpi-label { font-size: .625rem; color: #80868b; text-transform: uppercase; letter-spacing: .04em; }
.chart-kpi-value { font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pnl-chart-scroll { flex: 1; min-width: 0; }

.pnl-chart-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; gap: .75rem; flex-wrap: wrap;
}
.pnl-chart-title { font-size: .8125rem; font-weight: 600; color: #202124; display: flex; align-items: center; gap: .375rem; }
.pnl-chart-legend { display: flex; gap: .875rem; align-items: center; flex-wrap: wrap; margin-bottom: .375rem; }
.leg-item { display: flex; align-items: center; gap: .3rem; font-size: .6875rem; color: #5f6368; }
.leg-dot { width: .625rem; height: .625rem; border-radius: .2rem; flex-shrink: 0; }

/* !! FIX BUG GRAPHIQUE : hauteur fixe absolue + overflow:hidden !! */
.pnl-chart-fixed {
  position: relative;
  height: 190px;          /* hauteur fixe — le canvas ne peut plus grandir */
  width: 100%;
  overflow: hidden;       /* coupe tout débordement */
}
.pnl-chart-fixed canvas {
  position: absolute !important;  /* sort du flux pour éviter l'expansion */
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* ── Tableau scroll ───────────────────────────────────────── */
.pnl-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  flex: 1;
}

/* ══════════════════════════════════════════════════════════
   TABLEAU — Style Google Sheets
   ══════════════════════════════════════════════════════════ */
.pnl-table {
  border-collapse: collapse;
  font-family: var(--pnl-font);
  font-size: 13px;
  color: #202124;
  background: #fff;
  /* table-layout:auto → les largeurs de colonnes sont calculées par le navigateur
     à partir des contenus ET des widths CSS déclarées sur les th.
     Plus fiable avec des en-têtes en 2 niveaux (colspan/rowspan). */
  width: max-content;
  min-width: 100%;
}

/* ── En-têtes ─────────────────────────────────────────────── */
.pnl-table thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--gs-header-bg);
  color: var(--gs-header-txt);
  font-weight: 500;
  font-size: 12px;
  padding: 5px 8px;
  border: 1px solid var(--gs-border);
  white-space: nowrap;
  text-align: right;
}
/* Ligne 1 : groupes mois (colspan=2) */
.pnl-table thead tr.pnl-th-group th {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  border-bottom: 1px solid #bdc1c6;
}
/* Mois repliables : curseur + icône */
.pnl-table thead th.th-month-group[data-month] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  gap: .2rem;
}
.pnl-table thead th.th-month-group[data-month]:hover {
  background: #e8f0fe !important;
}
.month-collapse-icon {
  display: inline-block;
  font-size: 8px;
  opacity: .45;
  transition: transform .18s, opacity .18s;
  vertical-align: middle;
  margin-right: .15rem;
}
.pnl-table thead th.th-month-group.month-col-collapsed .month-collapse-icon {
  transform: rotate(180deg);
  opacity: .7;
}
/* Mois replié : fond légèrement différent sur les sous-en-têtes */
.pnl-table .th-sub-rel.month-col-only {
  border-left: 2px solid #a8c7fa;
}

/* Ligne 2 : sous-en-têtes Bgt / Réel — sticky décalé d'une hauteur de ligne */
.pnl-table thead tr.pnl-th-sub th { top: 29px; }
.pnl-table .th-sub      { font-size: 11px; font-weight: 600; text-align: center; }
.pnl-table .th-sub-bgt  { background: var(--gs-bgt-hd); color: var(--gs-bgt-txt);
                           width: var(--pnl-col-w); min-width: var(--pnl-col-w); }
.pnl-table .th-sub-rel  { background: var(--gs-rel-hd); color: var(--gs-rel-txt);
                           width: var(--pnl-col-w); min-width: var(--pnl-col-w); }

/* Colonne label (sticky H+V) */
.pnl-table thead th.th-label {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  left: 0;
  z-index: 30;
  border-right: 2px solid #bdc1c6;
  width: var(--pnl-label-w);
  min-width: var(--pnl-label-w);
  background: var(--gs-header-bg);
}
/* Groupe mois courant (ligne 1) */
.pnl-table .th-cur-group { background: #e8f0fe !important; color: var(--gs-select) !important; }
/* Groupe total annuel (ligne 1) */
.pnl-table .th-ann-group {
  background: #e8eaf6 !important; color: #3949ab !important;
  font-weight: 700; border-left: 2px solid #9fa8da;
}
/* Rétro-compatibilité anciennes classes */
.pnl-table .th-bgt      { background: var(--gs-bgt-hd); color: var(--gs-bgt-txt); font-size: 11px; font-weight: 600; }
.pnl-table .th-rel      { background: var(--gs-rel-hd); color: var(--gs-rel-txt); font-size: 11px; font-weight: 600; }
.pnl-table .th-cur      { background: #e8f0fe !important; color: var(--gs-select) !important; }
.pnl-table .th-cur-bgt  { background: #d2e3fc !important; color: #1557b0 !important; }
.pnl-table .th-cur-rel  { background: #ceead6 !important; color: #0d652d !important; }
.pnl-table .th-total-group { background: #e8eaf6 !important; color: #3949ab !important; font-weight: 700; border-left: 2px solid #9fa8da; }
.pnl-table .th-total-bgt   { background: #c5cae9 !important; color: #283593 !important; font-weight: 700; border-left: 2px solid #9fa8da; }
.pnl-table .th-total-rel   { background: #b2dfdb !important; color: #004d40 !important; font-weight: 700; }

/* ── Bandeau consolidé lecture seule ─────────────────────── */
.pnl-readonly-banner {
  display: flex; align-items: center; gap: .45rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  color: #1d4ed8;
  font-size: .75rem; font-weight: 500;
  padding: .45rem .75rem;
  margin-bottom: .5rem;
}
.pnl-readonly-banner svg { flex-shrink: 0; }

/* ── Séparateur de section (collapsible) ─────────────────── */
.pnl-sec td {
  background: var(--gs-sec-bg);
  color: #5f6368;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 4px;
  border: 1px solid var(--gs-border);
}

/* Cellule label : sticky + flex pour aligner toggle/icône/texte */
.pnl-sec-label {
  position: sticky; left: 0; z-index: 5;
  background: var(--gs-sec-bg);
  border-right: 2px solid #bdc1c6 !important;
  border-left-width: 3px !important;
  padding-left: 8px !important;
  display: flex;
  align-items: center;
  gap: .3rem;
  min-width: 160px;
}

.pnl-sec { cursor: pointer; user-select: none; }
.pnl-sec:hover td { filter: brightness(.96); }

/* Bouton toggle chevron */
.sec-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  flex-shrink: 0;
  border: none; background: none; padding: 0; cursor: pointer;
  color: #80868b;
  transition: transform .18s ease;
}
.sec-toggle svg { width: 12px; height: 12px; display: block; }
/* Rotation quand replié */
.pnl-sec[data-collapsed="1"] .sec-toggle { transform: rotate(-90deg); }

.sec-icon { font-style: normal; flex-shrink: 0; }

/* Lignes masquées lors d'un repliage */
.pnl-row.sec-hidden { display: none; }

/* Cellules de total par colonne (visibles quand la section est repliée) */
.pnl-sec-total-cell {
  text-align: right;
  padding: 3px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #5f6368;
  white-space: nowrap;
  border: 1px solid var(--gs-border);
}
.pnl-sec-tcell-bgt { color: #1a73e8; background: #f1f6ff; }
.pnl-sec-tcell-rel { color: #188038; background: #f0faf3; }
.pnl-sec-tcell-ann { background: #f8f9fa; font-weight: 800; }

/* Quand replié : le texte "v-zero" dans les cellules total doit être lisible */
.pnl-sec-total-cell .v-zero { color: #bdc1c6; }

/* Lignes d'employé salarié dans le P&L */
.pnl-row-emp td { background: #fafbff !important; }
.pnl-row-emp:hover td { background: #f0f5ff !important; }
.pnl-row-emp .pnl-cell-label { font-style: italic; }

/* Lignes sous-totaux personnel : Salaires bruts / Charges patronales */
.pnl-row-subtotal td {
  background: #f5f3ff !important;
  border-top: 1px dashed #ddd6fe !important;
}
.pnl-row-subtotal:hover td { background: #ede9fe !important; }
.pnl-row-subtotal .pnl-cell-label {
  font-size: .75rem;
  font-weight: 600;
  color: #7c3aed;
  padding-left: 1.6rem;
}
.pnl-row-subtotal .pnl-cell-val {
  font-size: .75rem;
  color: #7c3aed;
}
.pnl-row-chg .pnl-cell-label { color: #dc2626; }
.pnl-row-chg .pnl-cell-val   { color: #dc2626; }
.pnl-row-chg td               { background: #fff5f5 !important; border-top: none !important; }
.pnl-row-chg:hover td         { background: #fee2e2 !important; }
/* Mutuelle / Prévoyance / Formation */
.pnl-row-mut .pnl-cell-label { color: #2563eb; }
.pnl-row-mut .pnl-cell-val   { color: #2563eb; }
.pnl-row-mut td               { background: #eff6ff !important; border-top: none !important; }
.pnl-row-mut:hover td         { background: #dbeafe !important; }
/* Badge taux sur le label de charges */
.chg-rate-badge {
  display: inline-block;
  margin-left: .4rem;
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #dc2626;
  background: #fee2e2;
  border-radius: 3px;
  padding: 1px 4px;
  vertical-align: middle;
}
.emp-poste-label {
  display: inline-block;
  margin-left: .4rem;
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #8b5cf6;
  background: #f3f0ff;
  border-radius: 3px;
  padding: 1px 4px;
  vertical-align: middle;
  font-style: normal;
}
.emp-contract-dates {
  display: block;
  font-size: .6rem;
  color: #94a3b8;
  font-weight: 400;
  font-style: normal;
  margin-top: 1px;
  letter-spacing: 0;
  text-transform: none;
}

/* ── Lignes KPI indicateurs ───────────────────────────────── */
.pnl-row-kpi td { background: #f0f9ff !important; }
.pnl-row-kpi:hover td { background: #e0f2fe !important; }
.pnl-row-kpi .pnl-cell-label {
  font-weight: 600;
  color: #0369a1;
  font-size: .8125rem;
}
/* Section header indicateurs */
#sec-indicateurs { background: linear-gradient(90deg,#f0f9ff,#e0f2fe) !important; }
/* Valeurs KPI : couleur sémantique */
.kpi-val { font-weight: 700; font-size: .8rem; letter-spacing: -.01em; }
.kpi-pos { color: #16a34a; }  /* vert  : bon */
.kpi-mid { color: #d97706; }  /* orange : acceptable */
.kpi-neg { color: #dc2626; }  /* rouge : attention */
/* Hint formule sous le libellé */
.kpi-hint {
  display: block;
  font-size: .6rem;
  color: #94a3b8;
  font-weight: 400;
  font-style: italic;
  margin-top: 1px;
  letter-spacing: 0;
  text-transform: none;
}

/* ── Lignes données ───────────────────────────────────────── */
.pnl-row td {
  border: 1px solid var(--gs-border);
  padding: 0;
  height: 28px;
  vertical-align: middle;
}
.pnl-row:hover td { background: var(--gs-hover) !important; }
.pnl-row:hover .pnl-td-label { background: #d2e3fc !important; }

/* Colonne label (sticky) — .pnl-td-label ET alias .pnl-cell-label */
.pnl-td-label,
.pnl-cell-label {
  text-align: left !important;
  padding: 0 8px 0 14px !important;
  color: #202124;
  font-size: 13px;
  position: sticky; left: 0; z-index: 5;
  background: #fff;
  border-right: 2px solid #bdc1c6!important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: var(--pnl-label-w);
}

/* Cellules valeurs — PAS de display:flex sur <td> (casse table-layout) */
.pnl-td {
  text-align: right;
  vertical-align: middle;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: default;
  white-space: nowrap;
  padding: 0 !important;
  position: relative;   /* ancrage pour l'input en position absolute */
  height: 28px;
}
/* Wrapper interne : flex pour aligner valeur + badge */
.pnl-cell-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .2rem;
  padding: 0 6px 0 2px;
  height: 28px;
  box-sizing: border-box;
}
.pnl-td-bgt { background: var(--gs-bgt-bg); }
.pnl-td-rel { background: var(--gs-rel-bg); }
/* Cellules de la colonne Total annuel */
.pnl-td-ann { border-left: 2px solid #9fa8da !important; }
.pnl-td-ann.pnl-td-bgt { background: #e8eaf6 !important; }
.pnl-td-ann.pnl-td-rel { background: #e0f2f1 !important; }
/* Mois courant — surbrillance légère dans les données */
.td-cur.pnl-td-bgt { background: #f0f4ff; }
.td-cur.pnl-td-rel { background: #f0fff4; }
/* Lignes totales */
.pnl-td-total { font-weight: 700 !important; }
/* Rétro-compat */
.pnl-td-total-bgt { background: #e8eaf6 !important; border-left: 2px solid #9fa8da !important; font-weight: 600; }
.pnl-td-total-rel { background: #e0f2f1 !important; font-weight: 600; }

/* Span valeur dans la cellule */
.pnl-cell-val {
  flex: 1;
  text-align: right;
  white-space: nowrap;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* Rétro-compat */
.cell-val { flex: 1; text-align: right; white-space: nowrap; line-height: 1; }

/* Badge % (réel vs budget) */
.cell-pct, .cell-badge {
  font-size: 10px; font-weight: 700;
  padding: 1px 3px;
  border-radius: 3px;
  white-space: nowrap; flex-shrink: 0;
  line-height: 1.3;
}
.pct-pos, .cb-pos { background: #e6f4ea; color: #137333; }
.pct-neg, .cb-neg { background: #fce8e6; color: #c5221f; }

/* Cellule éditable */
.pnl-td.editable { cursor: pointer; }
.pnl-td.editable:hover { background: rgba(26,115,232,.07) !important; }

/* Cellule en cours d'édition — bordure Google bleue */
.pnl-td.editing {
  outline: 2px solid var(--gs-select) !important;
  outline-offset: -2px;
  background: #fff !important;
  z-index: 10;
}
/* Input in-place : couvre toute la cellule */
.pnl-cell-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none; outline: none;
  background: transparent;
  text-align: right;
  font-family: var(--pnl-font);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #202124;
  padding: 0 7px;
  box-sizing: border-box;
}

/* ── Ligne total ──────────────────────────────────────────── */
.pnl-row-total td {
  background: var(--gs-total-bg) !important;
  font-weight: 700;
  border-top: 2px solid #bdc1c6 !important;
  border-bottom: 2px solid #bdc1c6 !important;
}
.pnl-row-total .pnl-td-label,
.pnl-row-total .pnl-cell-label {
  background: #f1f3f4 !important;
  font-weight: 700;
  color: #202124;
}
.pnl-row-total:hover td { background: #d2e3fc !important; }
.pnl-row-total:hover .pnl-td-label,
.pnl-row-total:hover .pnl-cell-label { background: #c3d9fc !important; }
/* Hover corrigé pour flex td */
.pnl-row:hover .pnl-cell-label { background: #d2e3fc !important; }

/* Valeurs colorées */
.v-pos  { color: #137333; }
.v-neg  { color: #c5221f; }
.v-zero { color: #bdc1c6; font-size: 12px; }

/* ── Légende bas de tableau ───────────────────────────────── */
.pnl-hint {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .625rem;
  padding: .5rem 1rem;
  font-size: .6875rem;
  color: #80868b;
  border-top: 1px solid var(--gs-border);
  background: #fafafa;
}
.pnl-hint-bgt {
  display: inline-flex; align-items: center; gap: .25rem;
  font-weight: 600; color: var(--gs-bgt-txt);
}
.pnl-hint-bgt::before {
  content: ''; width: .75rem; height: .75rem;
  background: var(--gs-bgt-hd); border: 1px solid #9fa8da; border-radius: 2px; flex-shrink: 0;
}
.pnl-hint-rel {
  display: inline-flex; align-items: center; gap: .25rem;
  font-weight: 600; color: var(--gs-rel-txt);
}
.pnl-hint-rel::before {
  content: ''; width: .75rem; height: .75rem;
  background: var(--gs-rel-hd); border: 1px solid #81c995; border-radius: 2px; flex-shrink: 0;
}

/* ── Empty state ──────────────────────────────────────────── */
.pnl-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 5rem 2rem;
  text-align: center; gap: .75rem; color: #80868b;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .pnl-kpi-bar { grid-template-columns: 1fr 1fr; }
  :root { --pnl-col-w: 76px; --pnl-label-w: 160px; }
}
@media (max-width: 600px) {
  .pnl-kpi-bar { grid-template-columns: 1fr 1fr; gap: .375rem; padding: .5rem .75rem; }
  .kpi-amount { font-size: 1rem; }
  .pnl-toolbar { flex-direction: column; align-items: flex-start; }
  :root { --pnl-col-w: 68px; --pnl-label-w: 130px; }
}

/* ══ IMPRESSION / EXPORT PDF ══════════════════════════════════════════════ */
@media print {
  /* Masquer tout sauf le tableau P&L */
  .sidebar, .header, .pnl-toolbar, .pnl-kpi-bar,
  .pnl-hint, .no-print, .btn, button,
  #add-year-modal { display: none !important; }

  body { background: #fff !important; font-size: 8pt; }
  .pnl-page { padding: 0 !important; }

  /* Dé-geler les colonnes sticky pour l'impression */
  .pnl-label-col, .pnl-cell-label { position: static !important; }

  /* Tableau pleine largeur, police réduite */
  .pnl-table-wrap { overflow: visible !important; box-shadow: none !important; border-radius: 0 !important; }
  .pnl-table { font-size: 7pt; width: 100%; border-collapse: collapse; }
  .pnl-table th, .pnl-table td { padding: 2px 4px !important; }

  /* Couleurs simplifiées */
  .pnl-row-total td { background: #f1f5f9 !important; font-weight: 700; }
  .pnl-row-emp td   { background: #fafbff !important; }
  .pnl-row-kpi td   { background: #f0f9ff !important; }

  /* Forcer un saut de page avant la section indicateurs */
  #sec-indicateurs { page-break-before: always; }

  /* Titre auto en haut de page */
  @page { margin: 1cm; size: A3 landscape; }
}
