/* Agenda : semaine, mois, liste (mobile) */
.page-sub { margin-top: 4px; color: var(--ardoise); font-size: 14px; }
.agenda-page { margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.agenda-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.pager { display: inline-flex; align-items: center; gap: var(--sp-1); }
.pager svg.icon { width: 18px; height: 18px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); font-size: 13px; color: var(--ardoise); }
.cal-legend li { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.cal-legend i.due { border-radius: 1px; rotate: 45deg; background: none; border: 1.5px solid var(--ardoise); width: 7px; height: 7px; }
.agenda-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.agenda-empty p { max-width: 640px; }
.agenda-desk { padding: 0; overflow: hidden; }
.agenda-mobile { display: none; }

/* Pastilles (journée entière, mois) */
.ev-chip, .task-chip {
  display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; text-align: left;
  padding: 3px 7px; border-radius: 5px; font-size: 12px; line-height: 1.3;
}
.ev-chip { background: color-mix(in oklab, var(--c) 16%, var(--surface)); color: var(--graphite); box-shadow: inset 2px 0 0 var(--c); }
.ev-chip:hover { background: color-mix(in oklab, var(--c) 26%, var(--surface)); }
.ev-chip.past, .ev-block.past, .al-row.past { opacity: .55; }
.ev-chip .t, .task-chip .t, .ev-block .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-chip .mono, .task-chip .mono { font-size: 11px; color: var(--ardoise); flex: none; }
.task-chip { color: var(--graphite); }
.task-chip:hover { background: var(--surface-2); }
.task-chip i { flex: none; width: 7px; height: 7px; rotate: 45deg; border-radius: 1px; border: 1.5px solid var(--ardoise); }
.task-chip.late i { background: var(--ambre); border-color: var(--ambre); }

/* Semaine */
.week { --gutter: 56px; --hour-h: 44px; }
.wk-row { display: grid; grid-template-columns: var(--gutter) repeat(7, minmax(0, 1fr)); }
.wk-head { border-bottom: 1px solid var(--trait); }
.wk-day { display: flex; align-items: center; justify-content: center; gap: 6px; padding: var(--sp-3) 0 var(--sp-2); color: var(--ardoise); font-size: 13px; }
.wk-day .dnum { font: 600 18px/1 var(--f-titre); color: var(--graphite); }
.wk-day.today .dnum { color: var(--surface); background: var(--graphite); border-radius: 99px; padding: 4px 7px; margin-block: -4px; }
.wk-day:hover .dnum { text-decoration: underline; text-underline-offset: 3px; }
.wk-gutter { font-size: 11px; color: var(--ardoise); padding: var(--sp-2) var(--sp-2) 0 0; text-align: right; }
.wk-allday { border-bottom: 1px solid var(--trait); min-height: 36px; }
.wk-cell { display: flex; flex-direction: column; gap: 3px; padding: 4px 3px; border-left: 1px solid var(--trait); min-width: 0; }
.wk-body { position: relative; height: calc(var(--hour-count) * var(--hour-h)); }
.wk-hours { position: relative; padding: 0; }
.wk-hours span { position: absolute; right: var(--sp-2); translate: 0 -50%; font: 11px/1 var(--f-donnees); }
.wk-hours span:first-child { translate: 0 2px; }
.wk-hours span:last-child { translate: 0 -100%; }
.wk-col {
  position: relative; border-left: 1px solid var(--trait);
  background-image: linear-gradient(to bottom, var(--trait) 1px, transparent 1px);
  background-size: 100% var(--hour-h);
}
.wk-col.today { background-color: color-mix(in oklab, var(--surface-2) 55%, transparent); }
.ev-block {
  position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; overflow: hidden;
  margin-left: 2px; padding: 4px 6px; border-radius: 5px; text-align: left; font-size: 12px; line-height: 1.25;
  background: color-mix(in oklab, var(--c) 18%, var(--surface)); color: var(--graphite); box-shadow: inset 2px 0 0 var(--c), 0 0 0 1px var(--surface);
  transition: background-color .15s;
}
.ev-block:hover, .ev-block:focus-visible { background: color-mix(in oklab, var(--c) 30%, var(--surface)); z-index: 2; }
.ev-block .t { font-weight: 500; max-width: 100%; }
.ev-block .mono { font-size: 10.5px; color: var(--ardoise); }
.ev-block.short { flex-direction: row; gap: 6px; padding-block: 1px; align-items: center; }
.ev-block.short .mono { display: none; }
.now-line { position: absolute; left: -1px; right: 0; height: 0; border-top: 2px solid var(--ambre); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--ambre); }

/* Mois */
.month { padding: var(--sp-2); }
.mo-head, .mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mo-head span { padding: var(--sp-2); font-size: 12px; color: var(--ardoise); }
.mo-grid { gap: 1px; background: var(--trait); border: 1px solid var(--trait); border-radius: 8px; overflow: hidden; }
.mo-cell { position: relative; min-height: 112px; padding: 6px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mo-cell.out { background: var(--porcelaine); }
.mo-cell.out .mo-num { color: var(--ardoise); }
.mo-num { align-self: flex-start; font: 600 13px/1 var(--f-titre); padding: 4px 6px; border-radius: 99px; }
.mo-num:hover { background: var(--surface-2); }
.mo-cell.today .mo-num { background: var(--graphite); color: var(--surface); }
.mo-items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mo-more { font-size: 12px; color: var(--ardoise); padding: 0 7px; }
.mo-more:hover { color: var(--graphite); }
.mo-dots { display: none; }

/* Détail d'un rendez-vous */
.ev-pop { width: min(360px, calc(100vw - 32px)); margin: auto; padding: var(--sp-5); box-shadow: var(--glass-shadow); color: var(--graphite); }
.ev-pop::backdrop { background: rgb(0 0 0 / .18); }
.ev-pop h3 { font: 600 18px/1.25 var(--f-titre); margin: 6px 0; }
.ev-pop-cal { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ardoise); }
.ev-pop-cal i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.ev-pop-when { font-size: 12px; color: var(--ardoise); margin-bottom: var(--sp-3); }
.ev-pop-row { display: flex; align-items: center; gap: 6px; margin-bottom: var(--sp-2); }
.ev-pop-row svg.icon { width: 15px; height: 15px; color: var(--ardoise); }
.ev-pop-desc { font-size: 13px; color: var(--ardoise); margin-bottom: var(--sp-3); overflow-wrap: anywhere; max-height: 240px; overflow: auto; }
.ev-pop-desc p + p { margin-top: 6px; }

/* Liste (mobile) */
.agenda-list { display: flex; flex-direction: column; gap: var(--sp-5); }
.al-title { font: 600 14px/1.2 var(--f-titre); margin-bottom: var(--sp-2); }
.al-day.today .al-title { color: var(--graphite); }
.al-day.today .al-title::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ambre); margin-right: 8px; vertical-align: 2px; }
.agenda-list ul { list-style: none; margin: 0; padding: 0; }
.al-items { display: flex; flex-direction: column; gap: var(--sp-1); }
.al-row { display: grid; grid-template-columns: 92px 1fr; gap: var(--sp-3); width: 100%; text-align: left; align-items: start;
  padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--trait); box-shadow: inset 3px 0 0 var(--c); }
.al-row.now { border-color: var(--ambre); }
.al-row .when { font-size: 12px; color: var(--ardoise); padding-top: 2px; }
.al-row .what { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.al-row .sub { display: block; font-weight: 400; font-size: 12px; color: var(--ardoise); margin-top: 2px; }
.al-items .task-chip { padding: 8px 12px; font-size: 13px; }

@media (max-width: 767px) {
  .agenda-desk { display: none; }
  .agenda-mobile { display: flex; flex-direction: column; gap: var(--sp-4); }
  .agenda-mobile .card:has(.month) { padding: 0; }
  .agenda-bar { flex-direction: column; align-items: flex-start; }
  .mo-cell { min-height: 52px; padding: 4px; align-items: center; }
  .mo-items { display: none; }
  .mo-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
  .mo-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
  .mo-dots i.due { width: 5px; height: 5px; border-radius: 1px; rotate: 45deg; background: var(--ardoise); }
  .mo-head span { text-align: center; padding: 6px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ev-block { transition: none; }
}

.cal-legend, .aw-days, .am-next { list-style: none; padding-left: 0; }

/* Détail : visio, itinéraire, lieu à copier */
.ev-pop-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.ev-pop-actions .btn { gap: 6px; }
.ev-pop-actions svg.icon { width: 16px; height: 16px; }
.ev-pop-row > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ev-copy { flex: none; }
.ev-copy.copied { color: var(--succes); }
.ev-chip-video { width: 11px; height: 11px; flex: none; opacity: .8; }

/* Ajouter un événement / organiser une visio */
.event-form { max-width: 720px; margin-top: var(--sp-5); }
.event-when { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; }
.conflicts-box { margin: var(--sp-2) 0 var(--sp-3); padding: 10px 12px; border-radius: var(--r-ctrl); background: color-mix(in oklab, var(--ambre-doux) 80%, transparent); box-shadow: inset 3px 0 0 var(--ambre); font-size: 13.5px; }
.conflicts-box[hidden] { display: none; }
.conflicts-box ul { margin: 4px 0 0; padding-left: 18px; }
.conflicts-box .check-row { padding-top: 8px; font-weight: 500; }
.agenda-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.agenda-actions .btn { gap: 6px; }
.ev-pop-delete { margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--trait); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); font-size: 13px; }
.ev-pop-delete form { display: contents; }
.cal-legend .cal-manage { display: inline-flex; align-items: center; gap: 4px; }
