/* Planning annuel par technicien — 12 mini-calendriers */

.page-tech-year {
  overflow: auto;        /* on autorise le scroll vertical sur cette page */
}

.page-tech-year body {
  height: auto;
  min-height: 100vh;
}

/* ----- Topbar : on ajoute des controls ----- */
.ty-controls {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex: 1;
  justify-content: center;
}

.ty-select {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  min-width: 280px;
}

.ty-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ty-year {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.ty-arrow {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.ty-arrow:hover { background: var(--accent); color: white; }

.ty-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.ty-link:hover { color: var(--text); }

/* ----- Bandeau résumé ----- */
.ty-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 32px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  flex-wrap: wrap;
}

.ty-summary:empty { display: none; }

.ty-summary .stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.ty-summary .stat-value {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ty-summary .stat-label {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
}

/* ----- Grille des 12 mois ----- */
.ty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
  gap: 16px;
  padding: 16px 24px 32px;
}

.ty-grid .empty {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 60px;
  color: var(--muted);
  font-size: 18px;
}

.month {
  background: var(--bg-2);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.month.has-no-work {
  opacity: 0.45;
}

.month-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.month-name {
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.month-stats {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.month-stats .badge {
  display: inline-block;
  background: var(--bg-3);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--text);
  font-weight: 600;
}

/* La grille jour-par-jour : 7 colonnes */
.month-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.dow-cell {
  text-align: center;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding-bottom: 4px;
}

.day-cell {
  aspect-ratio: 1 / 1;
  background: var(--bg-3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  position: relative;
  cursor: default;
  overflow: hidden;
}

.day-cell.empty-pad {
  background: transparent;
}

.day-cell.is-weekend {
  background: rgba(255, 180, 84, 0.08);
}

.day-cell.is-today {
  outline: 2px solid var(--warn);
  outline-offset: -2px;
  z-index: 1;
}

.day-cell.has-work {
  color: white;
  background: var(--accent);   /* fallback ; surchargé par couleur projet via inline style */
  cursor: pointer;
}

.day-cell.has-work.is-leader::after {
  content: "★";
  position: absolute;
  top: -2px;
  right: 2px;
  font-size: 10px;
  color: var(--warn);
}

.day-cell.has-work .day-num {
  position: relative;
  z-index: 1;
  text-shadow: 0 0 3px rgba(0,0,0,0.6);
}

/* Si plusieurs projets le même jour : split horizontal */
.day-cell.multi {
  background: var(--bg-3);
}
.day-cell.multi .stripes {
  position: absolute;
  inset: 0;
  display: flex;
}
.day-cell.multi .stripes > span {
  flex: 1;
}

/* ----- Tooltip ----- */
.ty-tooltip {
  position: fixed;
  z-index: 100;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  max-width: 360px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: none;
}

.ty-tooltip[hidden] { display: none; }

.ty-tooltip .tt-project {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.ty-tooltip .tt-meta {
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.ty-tooltip .tt-row { display: flex; gap: 6px; }
.ty-tooltip .tt-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
