/* ──────────────────────────────────────────────────────────────
   Planning Setup — CSS application (au-dessus de pm-components.css)
   Styles spécifiques à la page /setup : layout, empty-state, dispo
   pills, topbar/aside layout, toast, etc.
   ────────────────────────────────────────────────────────────── */

html, body { height: 100%; }
body { background: var(--canvas); color: var(--color-text); }

/* ── Layout responsive ── */
body {
  display: block;
}

@media (min-width: 768px) {
  body { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
}

/* ── Empty state ── */
.empty-state {
  min-height: 100vh;
  background: var(--canvas);
  padding: 32px 22px 80px;
  display: block;
}
@media (min-width: 768px) {
  body.is-empty-state { display: block; }
  .empty-state {
    max-width: 560px;
    margin: 0 auto;
    padding-top: 80px;
  }
}
.empty-state__inner { max-width: 100%; }
.empty-cards {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.empty-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 120ms ease, background 120ms ease;
}
.empty-card:hover {
  border-color: var(--terra-300);
  background: var(--terra-50);
}
.empty-card__icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--terra-100);
  color: var(--terra-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.empty-card__text { flex: 1; min-width: 0; }
.empty-card__title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.empty-cta { margin-top: 28px; }

/* ── Side-nav desktop ── */
.pm-aside { display: none; }
@media (min-width: 768px) {
  .pm-aside {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--surface);
    border-right: 1px solid var(--ink-200);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
  .pm-aside__head { margin-bottom: 18px; }
  .pm-aside__progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
  }
  .pm-aside .pm-steps a {
    text-decoration: none;
  }
  .pm-aside__info {
    margin-top: auto;
    padding: 14px;
    background: var(--terra-50);
    border: 1px solid var(--terra-100);
    border-radius: 12px;
  }
}

/* ── Topbar mobile ── */
.pm-topbar--sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--ink-200);
  padding: 14px 16px 12px;
  display: block;
}
.pm-topbar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}
.pm-topbar__progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
@media (min-width: 768px) {
  .pm-topbar--sticky { display: none; }
}

/* ── Main pane ── */
.pm-main {
  background: var(--canvas);
  min-height: 100vh;
}
.pm-main__head {
  display: none;
}
@media (min-width: 768px) {
  .pm-main { padding: 32px 48px 80px; }
  .pm-main__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 720px;
    margin: 0 auto 14px;
  }
}
.pm-accordion {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 768px) {
  .pm-accordion {
    max-width: 720px;
    margin: 0 auto;
    padding: 0;
  }
}

/* ── Accordion body padding when closed (déjà géré par pm-components) ── */
.pm-acc[data-open="false"] .pm-acc__body { display: none; }
.pm-acc__head { cursor: pointer; min-height: var(--touch-target); }

/* ── Personne card ── */
.personne-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}
.personne-card__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 768px) {
  .personne-card__grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
}

/* ── Horaires grid ── */
.horaires-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.horaires-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}
.horaires-row__day {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-800);
}
.pm-input--sm {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 14px;
}
@media (min-width: 768px) {
  .horaires-row { grid-template-columns: 100px 1fr 1fr auto; }
}

/* ── Comp chips (checkboxes en pill horizontal) ── */
.comp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pm-check--chip {
  position: relative;
  padding: 8px 14px;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: var(--surface);
  min-height: 36px;
  user-select: none;
  transition: background 120ms ease, border-color 120ms ease;
}
.pm-check--chip:hover { border-color: var(--ink-300); }
.pm-check--chip .pm-check__box { display: none; }
.pm-check--chip:has(input:checked) {
  background: var(--terra-100);
  border-color: var(--terra-300);
  color: var(--terra-800);
  font-weight: 500;
}
.pm-check--inline { padding: 0 6px; min-height: 36px; gap: 6px; font-size: 14px; color: var(--ink-700); }
.pm-check--inline .pm-check__box { width: 18px; height: 18px; }

/* ── Dispo pills (jours indispo) ── */
.dispo-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dispo-pill {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--ink-200);
  color: var(--ink-800);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.dispo-pill:hover { background: var(--ink-50); border-color: var(--ink-300); }
.dispo-pill.is-off {
  background: var(--danger-50);
  border-color: var(--danger-100);
  color: var(--danger-700);
}
.dispo-pill.is-off .dispo-pill__short,
.dispo-pill.is-off .dispo-pill__long { text-decoration: line-through; }
.dispo-pill__short { font-size: 14px; font-weight: 700; }
.dispo-pill__long { display: none; }
.dispo-pill__state { font-size: 11px; font-weight: 500; opacity: 0.85; }

@media (min-width: 768px) {
  .dispo-pills { gap: 8px; }
  .dispo-pill {
    flex: 1;
    flex-direction: column;
    padding: 10px 6px;
    min-width: 0;
  }
  .dispo-pill__short { display: none; }
  .dispo-pill__long { display: block; font-size: 13px; font-weight: 600; }
  .dispo-pill__state { font-size: 12px; }
}

/* ── Saved indicator states ── */
.pm-saved[data-state="saving"] { color: var(--ink-600); }
.pm-saved[data-state="saving"] .pm-saved__icon { background: var(--ink-400); }
.pm-saved[data-state="error"] { color: var(--danger-700); }
.pm-saved[data-state="error"] .pm-saved__icon { background: var(--danger-600); }

/* ── Recap ── */
.recap-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recap-list li {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 14px;
}

/* ── Finalize ── */
.finalize-box { text-align: center; padding: 14px 0; }
.finalize-box p { margin: 0 0 10px; }
.finalized-msg {
  background: var(--success-50);
  color: var(--success-700);
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 12px !important;
}

/* ── Mobile bottom nav ── */
.pm-main__nav-mobile {
  padding: 16px;
  border-top: 1px solid var(--ink-200);
  background: var(--surface);
}
@media (min-width: 768px) { .pm-main__nav-mobile { display: none; } }

/* ── Toast (autosave error fallback / generic) ── */
.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink-900);
  color: var(--ink-50);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--sh-2);
  pointer-events: none;
  transition: transform 240ms ease;
  z-index: 100;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.is-error { background: var(--danger-700); color: #fff; }
.toast.is-success { background: var(--success-700); color: #fff; }
