/* Styles propres au template — le design system (copié du SSO) fournit les
   variables et composants ; ici seulement l'habillage spécifique. */

.app-navbar {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
}

.app-main { max-width: 1100px; }

.btn-nav-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}
.btn-nav-pill:hover { background: rgba(255, 255, 255, 0.22); }

.user-badge {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--clr-primary-light); color: var(--clr-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
}

/* Wizard */
.setup-steps { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.setup-step {
  flex: 1; text-align: center; padding: 0.6rem 0.25rem;
  border-radius: var(--r-md, 8px); font-size: 0.8rem; font-weight: 600;
  background: #f1f5f9; color: #64748b;
}
.setup-step.active { background: var(--clr-primary, #4f46e5); color: #fff; }
.setup-step.done   { background: var(--clr-success-light, #dcfce7); color: var(--clr-success, #16a34a); }

.check-line { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; }

code.copy-value {
  background: #f1f5f9; padding: 0.3rem 0.6rem; border-radius: 6px;
  font-size: 0.85rem; color: #334155; user-select: all;
}

/* ── Demande d'intervention ───────────────────────────────────────────── */

.iv-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.iv-dow {
  text-align: center; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8;
  padding-bottom: 4px;
}
.iv-day {
  aspect-ratio: 1.4; border: 1px solid #e2e8f0; border-radius: 10px;
  background: #fff; color: #334155; font-weight: 600; font-size: 0.9rem;
  transition: all 0.12s ease;
}
.iv-day:hover:not(:disabled) { border-color: var(--clr-primary, #4f46e5); background: #eef2ff; }
.iv-day:disabled { background: #f8fafc; color: #cbd5e1; border-color: transparent; }
.iv-day.selected {
  background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
  border-color: transparent; box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.iv-disabled { opacity: 0.35; pointer-events: none; }

.iv-lazy-btn {
  display: block; width: 100%; text-align: left;
  border: 2px dashed var(--clr-primary, #4f46e5); border-radius: 16px;
  background: #fff; padding: 1rem 1.25rem;
  transition: all 0.15s ease;
}
.iv-lazy-btn:hover { background: #eef2ff; }
.iv-lazy-btn .iv-lazy-title {
  display: block; font-weight: 700; font-size: 1.05rem;
  color: var(--clr-primary, #4f46e5);
}
.iv-lazy-btn .iv-lazy-sub {
  display: block; font-size: 0.85rem; color: #64748b; margin-top: 2px;
}
.iv-lazy-btn.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed); border-style: solid; border-color: transparent;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}
.iv-lazy-btn.active .iv-lazy-title { color: #fff; }
.iv-lazy-btn.active .iv-lazy-sub { color: rgba(255, 255, 255, 0.85); }

.iv-chip {
  border: 1px solid #e2e8f0; border-radius: 999px; background: #fff;
  color: #475569; font-weight: 600; font-size: 0.85rem; padding: 0.4rem 1rem;
  transition: all 0.12s ease;
}
.iv-chip:hover { border-color: var(--clr-primary, #4f46e5); }
.iv-chip.active {
  background: #eef2ff; border-color: var(--clr-primary, #4f46e5);
  color: var(--clr-primary, #4f46e5);
}

/* Popup douce : voile léger + carte arrondie, pas de flash agressif */
.iv-modal {
  position: fixed; inset: 0; z-index: 1050; display: none;
  align-items: center; justify-content: center; padding: 1rem;
  background: rgba(15, 23, 42, 0.35); backdrop-filter: blur(3px);
}
.iv-modal.show { display: flex; animation: ivFade 0.18s ease; }
.iv-modal-card {
  background: #fff; border-radius: 18px; padding: 1.75rem;
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  animation: ivRise 0.2s ease;
}
@keyframes ivFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ivRise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.iv-recap-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0.6rem 0; border-bottom: 1px solid #f1f5f9; font-size: 0.9rem;
}
.iv-recap-row:last-of-type { border-bottom: 0; }
.iv-recap-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: #94a3b8;
}

.iv-confirm-icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--clr-success-light, #dcfce7); color: var(--clr-success, #16a34a);
  font-size: 2rem;
}

/* ── Historique des interventions ─────────────────────────────────────── */

.iv-history-card {
  display: block; width: 100%; text-align: left;
  border: 1px solid #e2e8f0; border-radius: 12px;
  background: #fff; padding: 0.85rem 1rem;
  transition: all 0.12s ease;
}
.iv-history-card:hover {
  border-color: var(--clr-primary, #4f46e5);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.12);
}

.iv-stepper { display: flex; align-items: center; gap: 6px; }
.iv-step {
  flex: 1; height: 6px; border-radius: 999px; background: #e2e8f0;
  max-width: 64px;
}
.iv-step.filled { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.iv-step-label {
  font-size: 0.72rem; font-weight: 700; color: #64748b; margin-left: 4px;
  white-space: nowrap;
}

.iv-documents {
  border: 1.5px dashed #e2e8f0; border-radius: 12px; padding: 0.75rem 1rem;
  background: #f8fafc;
}

.iv-stepper-inline { width: 220px; flex-shrink: 0; }

/* Sans le JS Bootstrap, .dropdown-menu-end n'aligne PAS à droite (il attend
   data-bs-popper) : le menu du badge partait hors écran → scrollbars. */
.dropdown-menu-end.show { right: 0; left: auto; }

/* Panneau de choix d'adresse — mis en avant pour attirer l'oeil */
.iv-addr-panel {
  border: 2px solid var(--clr-primary, #4f46e5);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.12);
}
.iv-step-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
  font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}
.iv-addr-card {
  position: relative; display: flex; align-items: flex-start; gap: 0.5rem;
  cursor: pointer; border: 1.5px solid #e2e8f0; border-radius: 14px;
  padding: 0.85rem 1rem; transition: all 0.12s ease; margin-bottom: 0;
}
.iv-addr-card:hover { border-color: var(--clr-primary, #4f46e5); background: #f5f3ff; }
.iv-addr-card.active {
  border-color: var(--clr-primary, #4f46e5); background: #eef2ff;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.18);
}
.iv-addr-radio { position: absolute; opacity: 0; pointer-events: none; }
.iv-addr-check {
  color: var(--clr-primary, #4f46e5); font-size: 1.2rem; opacity: 0;
  transition: opacity 0.12s ease; align-self: center;
}
.iv-addr-card.active .iv-addr-check { opacity: 1; }
.iv-addr-billing {
  margin-top: 0.35rem; font-size: 0.78rem; color: #64748b;
}

/* Barre de validation toujours visible — l'utilisateur sait QUOI faire ensuite */
.iv-sticky-bar {
  position: sticky; bottom: 0; z-index: 100;
  display: flex; align-items: center; gap: 0.75rem;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px);
  border-top: 1px solid #e2e8f0; border-radius: 14px 14px 0 0;
  padding: 0.85rem 1.25rem; margin: 0 -0.5rem;
  box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
}

.iv-pending-warning {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 10px; padding: 0.6rem 0.9rem; font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* La demande fraîchement créée se signale à l'arrivée sur l'historique */
@keyframes ivNewPulse {
  0%   { background: #ede9fe; border-color: var(--clr-primary, #4f46e5); }
  100% { background: #fff; border-color: #e2e8f0; }
}
.iv-new { animation: ivNewPulse 2.5s ease 0.3s both; }

.iv-addr-card.disabled { opacity: 0.55; cursor: not-allowed; background: #f8fafc; }
.iv-addr-card.disabled:hover { border-color: #e2e8f0; box-shadow: none; }

/* Négociation de dates : marquages du calendrier */
.iv-day-client { border: 2px solid var(--clr-primary, #4f46e5); font-weight: 700; }
.iv-day-team {
  border: 2px solid var(--clr-success, #16a34a);
  background: var(--clr-success-light, #dcfce7); font-weight: 700;
}
.iv-day-locked { opacity: 0.45; text-decoration: line-through; }
.iv-day.selected.iv-day-team, .iv-day.selected.iv-day-client {
  border-color: transparent;
}
.iv-legend {
  display: inline-block; width: 12px; height: 12px; border-radius: 4px;
  vertical-align: -1px; margin-right: 2px;
}
.iv-legend-client { border: 2px solid var(--clr-primary, #4f46e5); }
.iv-legend-team { background: var(--clr-success-light, #dcfce7); border: 2px solid var(--clr-success, #16a34a); }

/* Tableau de bord équipe */
.dash-stat-alert { border: 2px solid var(--clr-danger, #dc2626); }
.dash-notification {
  padding: 0.7rem 0.25rem; border-bottom: 1px solid #f1f5f9;
}
.dash-notification:last-child { border-bottom: 0; }
.dash-date {
  width: 46px; text-align: center; border-radius: 10px; flex-shrink: 0;
  background: var(--clr-success-light, #dcfce7); padding: 4px 0;
}
.dash-date-day { font-weight: 800; font-size: 1.1rem; color: var(--clr-success, #16a34a); line-height: 1.1; }
.dash-date-month { font-size: 0.65rem; text-transform: uppercase; font-weight: 700; color: var(--clr-success, #16a34a); }

/* Avancement d'intervention — grand et lisible */
.iv-phase { font-weight: 600; font-size: 0.92rem; color: var(--clr-primary, #4f46e5); }
.iv-progress {
  height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden;
}
.iv-progress-lg { height: 14px; }
.iv-progress-fill {
  height: 100%; border-radius: 999px; transition: width 0.3s ease;
  background: linear-gradient(90deg, var(--theme-gradient-from, #4f46e5), var(--theme-gradient-to, #7c3aed));
}
.iv-progress-block {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 0.75rem 1rem;
}

/* Timeline d'étapes d'un dossier d'intervention */
.iv-steps-list {
  list-style: none; padding: 0; margin: 0;
}
.iv-step-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.iv-step-item:last-child { border-bottom: none; }
.iv-step-badge {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.85rem;
  background: #f1f5f9;
}
.iv-step-item.done .iv-step-badge { background: #dcfce7; }
.iv-step-item.active .iv-step-badge { background: #ede9fe; }
.iv-step-body { flex: 1; line-height: 1.4; }

/* ── Planning hebdomadaire du technicien ─────────────────────────────────── */
.planning-grid {
  display: grid; grid-template-columns: 52px repeat(7, 1fr); gap: 0;
  overflow-x: auto; min-width: 720px;
}
.planning-head { text-align: center; padding: 0.4rem 0.2rem; border-bottom: 2px solid #e2e8f0; }
.planning-head.planning-today { background: var(--clr-primary-light, #eef2ff); border-radius: 8px 8px 0 0; }
.planning-hours { position: relative; }
.planning-hour {
  font-size: 0.68rem; color: #94a3b8; text-align: right; padding-right: 6px;
  border-top: 1px solid transparent;
}
.planning-day {
  position: relative; border-left: 1px solid #e2e8f0;
  background-image: linear-gradient(to bottom, #eef1f6 1px, transparent 1px);
  background-repeat: repeat-y;
}
.planning-day.planning-today { background-color: rgba(79, 70, 229, 0.04); }
.planning-event {
  position: absolute; left: 3px; right: 3px; border-radius: 8px;
  padding: 2px 6px; overflow: hidden; text-decoration: none;
  font-size: 0.7rem; line-height: 1.25; display: block; z-index: 2;
}
.planning-event-fixed {
  background: var(--clr-success-light, #dcfce7);
  border: 1px solid var(--clr-success, #16a34a); color: #14532d;
}
.planning-event-pending {
  background: #fef9c3; border: 1px dashed #ca8a04; color: #713f12;
}
.planning-event:hover { filter: brightness(0.96); }
.planning-event-time { font-weight: 700; }
.planning-event-label { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.planning-legend {
  display: inline-block; width: 14px; height: 14px; border-radius: 4px;
  vertical-align: -2px; margin-right: 4px;
}
.planning-legend-fixed { background: var(--clr-success-light, #dcfce7); border: 1px solid var(--clr-success, #16a34a); }
.planning-legend-pending { background: #fef9c3; border: 1px dashed #ca8a04; }
.planning-offhours {
  position: absolute; left: 0; right: 0; background: rgba(148, 163, 184, 0.1);
  pointer-events: none; z-index: 0;
}
.planning-offhours-early { top: 0; }
.planning-offhours-late { bottom: 0; }

/* ── Cartes de créneaux proposés (réponse client) ────────────────────────── */
.iv-slot-card {
  border: 2px solid #e2e8f0; border-radius: 12px; background: #fff;
  padding: 0.75rem 1rem; text-align: left; min-width: 180px; cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.iv-slot-card:hover { border-color: var(--clr-primary, #4f46e5); }
.iv-slot-card.selected {
  border-color: var(--clr-primary, #4f46e5);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.iv-slot-card-taken {
  background: #f1f5f9; color: #94a3b8; cursor: not-allowed; border-style: dashed;
}

/* Planning — zoom Jour / Semaine / Mois */
.planning-breadcrumb a { color: inherit; text-decoration: none; }
.planning-breadcrumb a:hover { color: var(--clr-primary, #4f46e5); text-decoration: underline; }
.planning-grid-jour { grid-template-columns: 52px 1fr; min-width: 0; }
a.planning-head:hover { background: var(--clr-primary-light, #eef2ff); border-radius: 8px 8px 0 0; }
.planning-event-lg { font-size: 0.8rem; padding: 4px 10px; }
.planning-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #cbd5e1; font-size: 0.9rem; font-weight: 600;
}
.planning-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.planning-month-dow {
  text-align: center; font-size: 0.7rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; padding: 0.3rem 0;
}
.planning-month-cell {
  min-height: 84px; border: 1px solid #e2e8f0; border-radius: 10px; padding: 4px 6px;
  display: block; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.planning-month-cell:hover { border-color: var(--clr-primary, #4f46e5); box-shadow: 0 0 0 2px rgba(79,70,229,0.1); }
.planning-month-cell.planning-today { background: var(--clr-primary-light, #eef2ff); }
.planning-month-out { opacity: 0.42; }
.planning-month-daynum { font-size: 0.75rem; font-weight: 700; color: #64748b; margin-bottom: 2px; }
.planning-chip {
  display: flex; gap: 4px; align-items: baseline; font-size: 0.64rem; line-height: 1.3;
  border-radius: 5px; padding: 1px 5px; margin-bottom: 2px; overflow: hidden;
}
.planning-chip-fixed { background: var(--clr-success-light, #dcfce7); color: #14532d; }
.planning-chip-pending { background: #fef9c3; color: #713f12; border: 1px dashed #ca8a04; }
.planning-chip-label { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

/* Mobile : cellules compactes, chips réduits à des points colorés */
@media (max-width: 640px) {
  .planning-month { gap: 2px; }
  .planning-month-dow { font-size: 0.6rem; padding: 0.2rem 0; }
  .planning-month-cell { min-height: 44px; border-radius: 6px; padding: 2px 3px; }
  .planning-month-daynum { font-size: 0.7rem; margin-bottom: 3px; }
  .planning-chip { padding: 0; width: 8px; height: 8px; border-radius: 50%; margin: 0 1px 2px; flex-shrink: 0; }
  .planning-chip-label, .planning-chip span.fw-bold { display: none; }
  .planning-month-cell .text-xs { display: none; }
}
