/* Axper Europe — css/dashboard.css
   Vue d'ensemble : grille de cartes (semaine, envois, stock, activité). */

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.dash-card {
  background: var(--surface); border: 0; border-radius: var(--radius-lg); padding: 16px 18px 14px; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; min-width: 0; transition: box-shadow .3s, transform .4s var(--spring);
}
.enter .dash-card { animation: pageIn .6s var(--ease) both; }
.enter .dash-card:nth-child(2) { animation-delay: 80ms; }
.enter .dash-card:nth-child(3) { animation-delay: 160ms; }
.enter .dash-card:nth-child(4) { animation-delay: 240ms; }
.dash-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.dash-card-head h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: 0; }
.dash-card-head h2 .ico { color: var(--accent-ink); width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: var(--accent-soft); }
.dash-card-head a { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--accent-ink); text-decoration: none; white-space: nowrap; }
.dash-card-head a .ico { transition: transform .35s var(--spring); }
.dash-card-head a:hover { text-decoration: underline; }
.dash-card-head a:hover .ico { transform: translateX(3px); }
.dash-empty { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 14px; margin: 16px 0; }
.dash-empty .ico { color: var(--ok); }

/* La semaine */
.dash-week { display: grid; gap: 10px; }
.dash-day { display: grid; grid-template-columns: 52px 1fr; gap: 12px; }
.dash-date { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 6px; }
.dash-date strong { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.dash-date span { font-size: 12px; color: var(--faint); text-transform: capitalize; margin-top: 3px; }
.dash-day.today .dash-date strong { color: var(--accent-ink); }
.dash-items { display: grid; gap: 6px; min-width: 0; }
.dash-item {
  min-width: 0; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: var(--surface-2);
  border-radius: 12px; padding: 9px 12px 9px 9px; transition: transform .25s cubic-bezier(.5, 1.6, .4, 1), background-color .2s;
}
.dash-item:hover { transform: translateX(4px); background: var(--surface-3); }
.dash-item .bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--tone); flex-shrink: 0; }
.dash-time { font-weight: 700; font-size: 13px; min-width: 50px; font-variant-numeric: tabular-nums; color: var(--muted); }

/* Listes (envois, stock) */
.dash-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.dash-row .pill, .dash-row .icon-button { flex-shrink: 0; }
.dash-row { display: flex; align-items: center; gap: 12px; padding: 10px; margin: 0 -8px; border-radius: 14px; transition: background-color .2s; }
.dash-row:hover { background: var(--surface-2); }
.dash-site { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 0; }
.dash-site b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-site small { display: block; font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.dash-row .gauge { width: 70px; }
.dash-row .order { min-width: 36px; text-align: right; color: var(--low-ink); }

/* Activité récente */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line-soft); }
.timeline li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; }
.timeline li[data-planning-open] { cursor: pointer; }
.timeline li[data-planning-open]:hover .timeline-text { text-decoration: underline; text-decoration-color: var(--faint); }
.timeline-icon {
  position: relative; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--tone-bg, var(--neutral-bg)); color: var(--tone-ink, var(--neutral-ink)); border: 3px solid var(--surface);
}
.timeline-icon.ok { background: var(--ok-bg); color: var(--ok); }
.timeline-icon.low { background: var(--low-bg); color: var(--low-ink); }
.timeline-icon.neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
.timeline-text { font-size: 14px; }
.timeline small { display: block; font-size: 12px; color: var(--faint); margin-top: 3px; }

@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-stack { order: -1; } /* prochaine intervention et envois d’abord sur écran étroit */
}

/* ============ Sélecteur Journée / Semaine ============ */
.dash-card-head { flex-wrap: wrap; }
.dash-card-head h2 { margin-right: auto; }
.seg-toggle { position: relative; display: grid; grid-template-columns: 1fr 1fr; height: 32px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.seg-toggle::before {
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 8px;
  background: var(--surface); box-shadow: var(--shadow-md); transition: transform .4s cubic-bezier(.5, 1.5, .4, 1);
}
.seg-toggle.week::before { transform: translateX(100%); }
.seg-toggle button { position: relative; border: 0; background: none; padding: 0 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); transition: color .25s; }
.seg-toggle button[aria-pressed="true"] { color: var(--text); }

/* ============ Journée heure par heure ============ */
.day-loose { display: grid; gap: 6px; margin-bottom: 12px; }
.day-chip {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; border-radius: 12px; padding: 9px 12px;
  background: var(--surface-2); font-size: 13px; transition: transform .25s var(--spring), background-color .2s;
}
.day-chip:hover { transform: translateX(3px); background: var(--surface-3); }
.day-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); flex-shrink: 0; }
.day-chip span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-grid { position: relative; margin: 6px 0 4px; }
.day-hour { position: absolute; left: 0; right: 0; height: 0; display: flex; align-items: center; gap: 10px; }
.day-hour span { width: 34px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; transform: translateY(-50%); }
.day-hour::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-event {
  position: absolute; display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; text-align: left; border: 0;
  padding: 6px 10px; border-radius: 12px; background: var(--tone-bg); color: var(--text); box-shadow: inset 3px 0 0 var(--tone);
  transition: transform .25s var(--spring), filter .2s; z-index: 1;
}
.day-event:hover { transform: translateX(3px); filter: brightness(1.05); z-index: 2; }
.day-event.done { opacity: .55; }
.day-event-time { font-size: 11.5px; font-weight: 700; color: var(--tone-ink); font-variant-numeric: tabular-nums; }
.day-event strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-event small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--empty); z-index: 3; pointer-events: none; }
.day-now span {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%); padding: 1px 5px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; background: var(--empty); color: var(--on-tone); font-variant-numeric: tabular-nums;
}
.day-now::after { content: ""; position: absolute; left: 42px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--empty); animation: pulse 1.8s ease-out infinite; }

/* ============ Colonne de droite : prochaine intervention + envois ============ */
.dash-stack { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.next-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; text-align: left;
  border: 0; border-radius: var(--radius-lg); padding: 18px; background: var(--accent); color: var(--on-accent);
  box-shadow: 0 14px 30px -16px var(--accent); transition: transform .3s cubic-bezier(.5, 1.6, .4, 1);
}
.next-card::after { content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: color-mix(in srgb, #fff 18%, transparent); pointer-events: none; }
.next-card:hover { transform: translateY(-2px); }
.next-eyebrow { position: relative; font-size: 12.5px; font-weight: 600; opacity: .8; }
.next-title { position: relative; font-size: 22px; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
.next-address { position: relative; font-size: 12.5px; opacity: .75; }
.next-chips { position: relative; display: flex; flex-wrap: wrap; gap: 6px; }
.next-chips span { padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--on-accent) 12%, transparent); font-size: 12px; font-weight: 600; }
.enter .dash-stack > * { animation: pageIn .6s var(--ease) both; animation-delay: 80ms; }
