/* ═══════════════════════════════════════════════════════════════
   PROJECT DETAIL — Layout "Anchor Scroll" (sidebar + grille dense)
   Inspiré de la maquette 12. Scopé via .project-detail-view--anchor
   pour ne pas affecter PO/RMA detail qui partagent .project-detail-view.
   ═══════════════════════════════════════════════════════════════ */

/* Verrouille la zone main au viewport pour que seul le board scroll */
@media (min-width: 769px) {
  .app-container:has(#view-project-detail.active) {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
  .app-container:has(#view-project-detail.active) > .sidebar {
    max-height: 100dvh;
    overflow-y: auto;
  }
  .main-content:has(#view-project-detail.active) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
  }
  .main-content > #view-project-detail.active {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
}

/* ── Layout 2 colonnes (sidebar + board scrollable) ── */
.project-detail-view--anchor {
  height: 100%;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: #f3f4f6;
  font-family: -apple-system, 'Inter', sans-serif;
  overflow: hidden;
  max-width: none;
  padding: 0;
  margin: 0;
}

/* ── Sidebar navigation ── */
.project-detail-nav {
  background: #0f172a;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.4) transparent;
}
.project-detail-nav-brand {
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid #1e293b;
}
.project-detail-nav-num {
  font-family: monospace;
  font-size: 0.72rem;
  color: #60a5fa;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.project-detail-nav-name {
  font-size: 1.02rem;
  font-weight: 700;
  margin-top: 0.2rem;
  line-height: 1.2;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-detail-nav-client {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-detail-nav-hint {
  padding: 0.55rem 1rem;
  font-size: 0.7rem;
  color: #64748b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 1px solid #1e293b;
}
.project-detail-nav-list {
  padding: 0.5rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}
.pd-nav-item {
  display: grid;
  grid-template-columns: 22px 1fr 8px;
  gap: 0.55rem;
  align-items: center;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.15s;
  position: relative;
}
.pd-nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.pd-nav-item.is-active {
  background: linear-gradient(90deg, rgba(96,165,250,0.2), transparent);
  color: #fff;
  font-weight: 600;
}
.pd-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #60a5fa;
}
.pd-nav-ic { font-size: 1rem; text-align: center; }
.pd-nav-l  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-nav-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s;
}
.pd-nav-item:hover .pd-nav-bullet { background: rgba(255,255,255,0.3); }
.pd-nav-item.is-active .pd-nav-bullet { background: #60a5fa; }

/* ── Board scrollable (zone droite) ── */
.project-detail-view--anchor .project-detail-board {
  overflow-y: auto;
  scroll-behavior: smooth;
  background: #f3f4f6;
  position: relative;
  --pd-header-offset: 130px;
  scrollbar-width: thin;
}

/* Header + quick-actions stickés en haut de la zone scrollable */
.project-detail-view--anchor .project-detail-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f3f4f6;
  padding: 1rem 1.5rem 0.65rem;
}
.project-detail-view--anchor .project-detail-sticky .project-header { margin-bottom: 0.65rem; }
.project-detail-view--anchor .project-detail-sticky .project-quick-actions { margin-bottom: 0; }

/* ── Grille dense (toutes les tuiles, plus aucun trou) ── */
.project-detail-view--anchor .project-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: auto;
  gap: 1rem;
  align-items: start;
  padding: 0 1.5rem 4rem;
}

/* Wides intermédiaires (Notes, Documents, Contacts, Estim) : span 2 */
.project-detail-view--anchor .project-cards-grid .project-card-wide {
  grid-column: span 2;
}
/* Fullwidth (Bacs : liste horizontale dense) */
.project-detail-view--anchor .project-cards-grid .project-card-fullwidth {
  grid-column: 1 / -1;
}
@media (min-width: 1600px) {
  .project-detail-view--anchor .project-cards-grid .project-card-wide {
    grid-column: span 3;
  }
}

/* ── Ligne 1 : Info à gauche (1 col) + Tickets à droite (remplit le reste) ── */
.project-detail-view--anchor .project-cards-grid .project-card-top-info {
  grid-column: 1;
  grid-row: 1;
}
.project-detail-view--anchor .project-cards-grid .project-card-top-tickets {
  grid-column: 2 / -1;
  grid-row: 1;
}
/* Mobile : Info et Tickets reviennent en pleine largeur empilés */
@media (max-width: 760px) {
  .project-detail-view--anchor .project-cards-grid .project-card-top-info,
  .project-detail-view--anchor .project-cards-grid .project-card-top-tickets {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

/* Photos : tuile carrée avec scroll interne sur le card-body */
.project-detail-view--anchor .project-card.project-card-photo {
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.project-detail-view--anchor .project-card.project-card-photo .card-header {
  flex-shrink: 0;
}
.project-detail-view--anchor .project-card.project-card-photo .card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

/* Scroll-margin + flash visuel sur ancrage */
.project-detail-view--anchor .project-card {
  scroll-margin-top: calc(var(--pd-header-offset) + 12px);
  transition: box-shadow 0.4s, transform 0.4s;
  min-width: 0;
}
.project-detail-view--anchor .project-card.pd-flash {
  box-shadow: 0 0 0 3px #60a5fa, 0 12px 28px rgba(59,130,246,0.35) !important;
  transform: translateY(-2px);
}

/* ── Fixes sous-éléments natifs adaptés aux tuiles compactes ── */
.project-detail-view--anchor .card-header {
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  align-items: center;
}
.project-detail-view--anchor .card-header > h3 {
  white-space: normal;
  word-wrap: break-word;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}
.project-detail-view--anchor .card-body { min-width: 0; }
.project-detail-view--anchor .card-body > * { min-width: 0; max-width: 100%; }

/* Info grid */
.project-detail-view--anchor .info-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
}
.project-detail-view--anchor .info-grid .info-item { min-width: 0; }
.project-detail-view--anchor .info-label {
  font-size: 0.7rem;
  display: block;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-detail-view--anchor .info-value {
  font-size: 0.85rem;
  word-wrap: break-word;
}

/* Worker cards */
.project-detail-view--anchor .worker-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
}
.project-detail-view--anchor .worker-avatar { width: 40px; height: 40px; flex-shrink: 0; }
.project-detail-view--anchor .avatar-initials { font-size: 0.85rem; }
.project-detail-view--anchor .worker-info { min-width: 0; }
.project-detail-view--anchor .worker-name {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-detail-view--anchor .worker-start {
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-detail-view--anchor .worker-timer {
  font-size: 1rem;
  min-width: auto;
  white-space: nowrap;
  text-align: right;
}

/* Liste compacte (RDV) */
.project-detail-view--anchor .list-compact-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.project-detail-view--anchor .list-compact-item:last-child { border-bottom: none; }

/* Budget */
.project-detail-view--anchor .budget-header,
.project-detail-view--anchor .budget-details {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.85rem;
}

/* Time stats */
.project-detail-view--anchor .time-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.55rem;
}

/* ── Mobile : sidebar en haut, board en dessous ── */
@media (max-width: 1024px) {
  .project-detail-view--anchor { grid-template-columns: 200px 1fr; }
}
@media (max-width: 760px) {
  .project-detail-view--anchor { grid-template-columns: 1fr; }
  .project-detail-nav {
    max-height: 28vh;
    border-bottom: 1px solid #1e293b;
  }
  .project-detail-view--anchor .project-detail-sticky {
    padding: 0.75rem 0.85rem 0.5rem;
  }
  .project-detail-view--anchor .project-cards-grid {
    grid-template-columns: 1fr;
    padding: 0 0.85rem 4rem;
  }
  .project-detail-view--anchor .project-cards-grid .project-card-wide,
  .project-detail-view--anchor .project-cards-grid .project-card-fullwidth {
    grid-column: 1 / -1;
  }
}

/* ─────────────────────────────────────────────────────────────
   Project Timesheet — Aperçu compact (tuile) + Vue plein écran
   ───────────────────────────────────────────────────────────── */

/* ── Tuile compacte cliquable (aperçu) ── */

#project-timesheet-card { min-height: 0; cursor: pointer; transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease; }
#project-timesheet-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}
.project-card-clickable {
  position: relative;
}
.project-card-clickable:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
.psheet-tile-chevron {
  font-size: 1.5rem;
  color: #94a3b8;
  transition: transform 120ms ease, color 120ms ease;
}
#project-timesheet-card:hover .psheet-tile-chevron {
  color: #3b82f6;
  transform: translateX(2px);
}

.psheet-preview {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.psheet-preview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
}
.psheet-preview-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  text-align: center;
}
.psheet-preview-stat--open {
  background: linear-gradient(180deg, #f0fdf4, #dcfce7);
  border-color: #86efac;
  animation: psheet-pulse 2s ease-in-out infinite;
}
.psheet-preview-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.psheet-preview-stat-label {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 2px;
}
.psheet-preview-cta {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #3b82f6;
  padding-top: 0.35rem;
  border-top: 1px dashed #e2e8f0;
}

/* ── Toolbar interne de l'ancienne tuile (encore utilisée dans la vue plein écran Jour) ── */
.psheet-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.psheet-toolbar input[type="date"] {
  padding: 0.3rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.85rem;
  background: #fff;
}
.psheet-toolbar .btn-sm {
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
  line-height: 1;
}

.psheet-body {
  padding: 0.75rem 0.85rem 0.85rem;
  background: #fbfbfd;
  min-height: 160px;
}

/* ── Vue plein écran (overlay modal) ── */

.ps-fs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 9000;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  animation: ps-fs-fade-in 180ms ease;
}
@keyframes ps-fs-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.ps-fs-shell {
  background: #fff;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ps-fs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc, #fff);
}
.ps-fs-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.ps-fs-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 120ms ease, color 120ms ease;
}
.ps-fs-close:hover { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.ps-fs-h1 { font-size: 1.1rem; font-weight: 700; color: #0f172a; line-height: 1.2; }
.ps-fs-h2 { font-size: 0.85rem; color: #64748b; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-fs-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

.ps-fs-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fbfbfd;
}
.ps-fs-tab {
  padding: 0.45rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  transition: all 120ms ease;
}
.ps-fs-tab:hover { background: #f1f5f9; color: #0f172a; }
.ps-fs-tab--active {
  background: #fff;
  border-color: #3b82f6;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.18);
}
.ps-fs-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.ps-fs-nav input[type="date"] {
  padding: 0.3rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.85rem;
  background: #fff;
}

.ps-fs-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.55rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.ps-fs-filter-label { font-size: 0.82rem; color: #64748b; font-weight: 600; }
.ps-fs-filter-empty { font-size: 0.85rem; color: #94a3b8; font-style: italic; }
.ps-fs-filter-pill {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  color: #475569;
  transition: all 120ms ease;
}
.ps-fs-filter-pill:hover { border-color: #94a3b8; }
.ps-fs-filter-pill--active {
  background: #3b82f6;
  border-color: #2563eb;
  color: #fff;
}
.ps-fs-filter-pill--active strong { color: #fff; }

.ps-fs-content {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.25rem 2rem;
  background: #f8fafc;
}

/* ── Vue Semaine — grille employés × jours ── */
.ps-wk-grid {
  display: grid;
  grid-template-columns: 200px repeat(7, minmax(140px, 1fr)) 100px;
  gap: 1px;
  background: #e2e8f0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}
.ps-wk-row { display: contents; }
.ps-wk-cell {
  background: #fff;
  padding: 0.55rem 0.65rem;
  font-size: 0.85rem;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: stretch;
  justify-content: flex-start;
}
.ps-wk-cell--name { font-weight: 700; color: #0f172a; justify-content: center; background: #f8fafc; }
.ps-wk-cell--head {
  background: linear-gradient(180deg, #f1f5f9, #e2e8f0);
  text-align: center;
  font-weight: 600;
  min-height: 0;
  padding: 0.4rem 0.3rem;
  align-items: center;
  justify-content: center;
}
.ps-wk-cell--total {
  background: #fef9c3;
  text-align: center;
  justify-content: center;
  align-items: center;
}
.ps-wk-row--header .ps-wk-cell, .ps-wk-row--header .ps-wk-cell--total {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}
.ps-wk-cell--today {
  background: #eff6ff !important;
  position: relative;
}
.ps-wk-cell--today::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #3b82f6;
}
.ps-wk-head-dow { font-size: 0.85rem; color: #475569; }
.ps-wk-head-date { font-size: 0.75rem; color: #94a3b8; font-weight: 600; margin-top: 1px; }
.ps-wk-cell-pills {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ps-wk-pill {
  font-size: 0.7rem;
  font-family: monospace;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
  cursor: pointer;
  transition: background 120ms ease;
  text-align: center;
}
.ps-wk-pill:hover { background: #bfdbfe; }
.ps-wk-pill--open {
  background: linear-gradient(180deg, #d1fae5, #a7f3d0);
  border-color: #34d399;
  color: #065f46;
  animation: psheet-pulse 2.2s ease-in-out infinite;
}
.ps-wk-cell-sum {
  margin-top: auto;
  font-weight: 700;
  font-size: 0.85rem;
  color: #0f172a;
  text-align: right;
}
.ps-wk-cell-sum--open { color: #065f46; }
.ps-wk-cell-add {
  margin-top: auto;
  text-align: center;
  color: #cbd5e1;
  font-size: 1.2rem;
  cursor: pointer;
  user-select: none;
  transition: color 120ms ease;
}
.ps-wk-cell-add:hover { color: #3b82f6; }
.ps-wk-row--footer .ps-wk-cell {
  background: #fff7ed;
  font-weight: 700;
  color: #9a3412;
  min-height: 0;
  padding: 0.5rem 0.65rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ── Vue Mois — calendrier mensuel ── */
.ps-mo-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.ps-mo-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  text-align: center;
}
.ps-mo-stat-val { font-size: 1.25rem; font-weight: 700; color: #0f172a; line-height: 1.1; }
.ps-mo-stat-lbl { font-size: 0.72rem; color: #64748b; margin-top: 2px; }

.ps-mo-grid {
  background: #e2e8f0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}
.ps-mo-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e2e8f0;
}
.ps-mo-head {
  background: linear-gradient(180deg, #f1f5f9, #e2e8f0);
  text-align: center;
  padding: 0.5rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}
.ps-mo-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e2e8f0;
}
.ps-mo-cell {
  position: relative;
  background: #fff;
  min-height: 92px;
  padding: 0.4rem 0.5rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}
.ps-mo-cell:hover {
  background: #f8fafc;
  box-shadow: inset 0 0 0 2px #93c5fd;
  z-index: 2;
}
.ps-mo-cell--out {
  background: #fafafa;
  color: #cbd5e1;
}
.ps-mo-cell--out .ps-mo-cell-num { color: #cbd5e1; }
.ps-mo-cell--out:hover { background: #f1f5f9; box-shadow: inset 0 0 0 1px #cbd5e1; }
.ps-mo-cell--we { background: #fefce8; }
.ps-mo-cell--we.ps-mo-cell--out { background: #fafafa; }
.ps-mo-cell--today {
  background: #eff6ff !important;
}
.ps-mo-cell--today .ps-mo-cell-num {
  background: #3b82f6;
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.ps-mo-cell--has {
  background: linear-gradient(180deg, #ecfdf5, #d1fae5);
  border-left: 3px solid #10b981;
}
.ps-mo-cell--has.ps-mo-cell--today {
  background: linear-gradient(180deg, #eff6ff, #d1fae5) !important;
}
.ps-mo-cell--has.ps-mo-cell--out { display: none; }
.ps-mo-cell-num {
  font-weight: 700;
  font-size: 0.85rem;
  color: #475569;
  align-self: flex-start;
}
.ps-mo-cell-total {
  font-size: 1.05rem;
  font-weight: 700;
  color: #065f46;
  line-height: 1.1;
}
.ps-mo-cell-meta {
  display: flex;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: #475569;
}
.ps-mo-cell-users { font-weight: 600; }
.ps-mo-cell-punches { color: #94a3b8; }
.ps-mo-cell-open {
  font-size: 0.65rem;
  font-weight: 700;
  color: #065f46;
  background: #fff;
  padding: 0.1rem 0.35rem;
  border-radius: 8px;
  border: 1px solid #6ee7b7;
  align-self: flex-start;
  margin-top: auto;
  animation: psheet-pulse 2s ease-in-out infinite;
}

/* ── Responsive vue plein écran ── */
@media (max-width: 1100px) {
  .ps-wk-grid { grid-template-columns: 140px repeat(7, minmax(90px, 1fr)) 80px; font-size: 0.78rem; }
  .ps-wk-pill { font-size: 0.62rem; }
  .ps-mo-cell { min-height: 78px; padding: 0.3rem 0.4rem; }
  .ps-mo-cell-total { font-size: 0.9rem; }
}
@media (max-width: 768px) {
  .ps-fs-header { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .ps-fs-tabs { flex-wrap: wrap; }
  .ps-fs-nav { width: 100%; justify-content: flex-end; }
  .ps-wk-grid {
    grid-template-columns: 1fr;
  }
  .ps-wk-row { display: block; border-bottom: 1px solid #e2e8f0; padding: 0.5rem 0; }
  .ps-wk-row--header { display: none; }
  .ps-wk-cell { border: none; padding: 0.4rem 0.65rem; min-height: 0; }
  .ps-wk-cell--name { background: #1e293b; color: #fff; font-size: 0.95rem; padding: 0.5rem 0.65rem; }
  .ps-mo-cell { min-height: 60px; padding: 0.25rem 0.3rem; }
  .ps-mo-cell-meta, .ps-mo-cell-open { display: none; }
  .ps-mo-cell-total { font-size: 0.8rem; }
}

.psheet-day-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
  text-transform: capitalize;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px dashed #e2e8f0;
}

/* ── Timeline graphique 6h → 22h ── */
.psheet-tl {
  position: relative;
  padding: 0.4rem 0 0.5rem;
  margin-bottom: 0.65rem;
}
.psheet-tl__ruler {
  position: relative;
  height: 14px;
  margin-bottom: 4px;
  border-bottom: 1px dotted #cbd5e1;
}
.psheet-tl__tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
}
.psheet-tl__bar {
  position: relative;
  height: 26px;
  background: repeating-linear-gradient(
    90deg,
    #f1f5f9 0 calc(100%/8 - 1px),
    #e2e8f0 calc(100%/8 - 1px) calc(100%/8)
  );
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
.psheet-tl__block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0.35rem;
  cursor: pointer;
  transition: filter 120ms ease, transform 120ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.psheet-tl__block:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.18); }
.psheet-tl__block--c0 { background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff; }
.psheet-tl__block--c1 { background: linear-gradient(180deg, #10b981, #059669); color: #fff; }
.psheet-tl__block--c2 { background: linear-gradient(180deg, #f59e0b, #d97706); color: #fff; }
.psheet-tl__block--c3 { background: linear-gradient(180deg, #8b5cf6, #7c3aed); color: #fff; }
.psheet-tl__block--c4 { background: linear-gradient(180deg, #ec4899, #db2777); color: #fff; }
.psheet-tl__block--c5 { background: linear-gradient(180deg, #14b8a6, #0d9488); color: #fff; }
.psheet-tl__block--c6 { background: linear-gradient(180deg, #f97316, #ea580c); color: #fff; }
.psheet-tl__block--c7 { background: linear-gradient(180deg, #6366f1, #4f46e5); color: #fff; }
.psheet-tl__block--open {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.5), 0 0 10px rgba(16, 185, 129, 0.35);
  animation: psheet-pulse 2s ease-in-out infinite;
}
@keyframes psheet-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.5), 0 0 10px rgba(16, 185, 129, 0.35); }
  50%      { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.65), 0 0 16px rgba(16, 185, 129, 0.5); }
}
.psheet-tl__lbl {
  font-size: 0.7rem;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* ── Liste détaillée des entries ── */
.psheet-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.psheet-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0.65rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.psheet-row:hover { border-color: #cbd5e1; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.psheet-row--open { border-color: #10b981; background: linear-gradient(180deg, #fff, #f0fdf4); }

.psheet-row__times { font-size: 0.85rem; }
.psheet-row__hour {
  font-family: monospace;
  font-weight: 700;
  color: #0f172a;
}
.psheet-row__sep { margin: 0 0.25rem; color: #94a3b8; font-weight: 400; }
.psheet-row__dur {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 1px;
}

.psheet-row__main { min-width: 0; }
.psheet-row__top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.psheet-row__user {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.9rem;
}
.psheet-row__notes {
  font-size: 0.78rem;
  color: #475569;
  margin-top: 2px;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
}

.psheet-row__actions {
  display: flex;
  gap: 0.25rem;
}
.psheet-row__actions .btn-sm {
  padding: 0.25rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1;
}

/* Badges */
.psheet-open {
  font-size: 0.7rem;
  font-weight: 700;
  color: #065f46;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  padding: 0.05rem 0.4rem;
  border-radius: 8px;
}
.psheet-src {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
}
.psheet-src--manual { background: #fef9c3; color: #713f12; border: 1px solid #facc15; }
.psheet-src--punch  { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }
.psheet-src--auto   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.psheet-billed {
  font-size: 0.65rem;
  font-weight: 700;
  color: #6b21a8;
  background: #f3e8ff;
  border: 1px solid #d8b4fe;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
}

/* Empty state */
.psheet-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: #94a3b8;
  font-size: 0.9rem;
}
.psheet-empty-ic { font-size: 2rem; opacity: 0.6; margin-bottom: 0.35rem; }

/* Footer totaux */
.psheet-footer {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.psheet-tot {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}
.psheet-tot strong { color: #065f46; }
.psheet-tot-by {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.psheet-tot-pill {
  font-size: 0.72rem;
  color: #475569;
  background: #f1f5f9;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

/* Responsive : sur écran étroit, on empile les colonnes de la row */
@media (max-width: 640px) {
  .psheet-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .psheet-row__actions { justify-content: flex-end; }
  .psheet-tl__bar { height: 20px; }
}
