body { line-height: 1.5; }
.suivi-page { padding-top: 24px; padding-bottom: 56px; flex: 1; }

/* ── Barre de recherche ─────────────────────────────────────────────── */
.track-bar { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding: 28px 0 32px; }
.track-bar h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 6px; }
.track-bar p { font-size: 14px; color: var(--on-surface-variant); }
.track-form { position: relative; display: flex; align-items: center; width: 100%; max-width: 520px; }
.track-ico { position: absolute; left: 14px; width: 18px; height: 18px; stroke: var(--on-surface-muted); pointer-events: none; }
.track-form input { width: 100%; height: 48px; padding: 0 130px 0 42px; border: 1px solid var(--ghost-outline-solid); border-radius: 0.6rem; background: var(--surface-low); font-family: var(--font-data); font-size: 14px; font-weight: 500; text-transform: uppercase; color: var(--on-surface); outline: none; transition: background 0.15s, box-shadow 0.15s, border-color 0.15s; }
.track-form input:focus { background: var(--surface-lowest); border-color: var(--primary-container); box-shadow: 0 0 0 3px rgba(0,109,50,0.12); }
.track-form input::placeholder { text-transform: none; color: var(--on-surface-muted); font-weight: 400; }
.track-btn { position: absolute; right: 5px; top: 5px; bottom: 5px; padding: 0 16px; background: var(--primary-container); color: #fff; border: none; border-radius: 0.45rem; font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
.track-btn:hover { background: var(--primary); box-shadow: 0 2px 8px rgba(0,109,50,0.3); }

/* Une fois un dossier affiché : une seule ligne, libellé à gauche, champ à droite */
.track-bar.compact { flex-direction: row; justify-content: space-between; text-align: left; padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--ghost-outline-solid); }
.track-bar.compact h1 { font-size: 15px; margin: 0; }
.track-bar.compact p { display: none; }
.track-bar.compact .track-form { max-width: 440px; }
.track-bar.compact .track-form input { height: 40px; padding-right: 120px; font-size: 13px; }
.track-bar.compact .track-btn { top: 4px; bottom: 4px; right: 4px; padding: 0 14px; font-size: 12px; }

/* ── États ──────────────────────────────────────────────────────────── */
.state-empty, .state-loading { text-align: center; padding: 48px 20px; color: var(--on-surface-muted); font-size: 14px; }
.state-empty-icon { font-size: 36px; margin-bottom: 10px; }
.state-error { background: var(--error-light); border: 1px solid #ffb4a8; border-radius: 0.75rem; padding: 18px 20px; color: var(--error); font-size: 13.5px; font-weight: 500; max-width: 520px; margin: 8px auto 20px; text-align: center; }
.state-error + .help-card { max-width: 520px; margin: 0 auto; }

/* ── Cartes ─────────────────────────────────────────────────────────── */
.card { background: var(--surface-lowest); border: 1px solid var(--ghost-outline-solid); border-radius: 0.85rem; box-shadow: 0 4px 20px -2px rgba(11,28,48,0.05); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-surface-muted); margin-bottom: 14px; }
.card-title svg { width: 16px; height: 16px; stroke: var(--primary); flex-shrink: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--ghost-outline-solid); }
.card-lead { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.card-head .card-title { margin-bottom: 0; }
.card-head .muted { font-size: 11px; color: var(--on-surface-muted); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-surface-muted); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-top .card-title { margin-bottom: 0; min-width: 0; }
.card-title span { min-width: 0; }
.card-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.badge-soft { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 8px; border-radius: 0.3rem; background: var(--primary-fixed); color: var(--primary); border: 1px solid rgba(0,109,50,0.2); white-space: nowrap; }
.badge-soft.warn { background: #fff4e0; color: #8a5a00; border-color: rgba(138,90,0,0.25); }
.chev { width: 26px; height: 26px; border: none; border-radius: 0.4rem; background: transparent; color: var(--on-surface-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s; }
.chev:hover { background: var(--surface-mid); color: var(--primary); }
.chev svg { width: 16px; height: 16px; stroke: currentColor; transition: transform 0.2s; }
.chev[aria-expanded="false"] svg { transform: rotate(-90deg); }

/* ── Cockpit : en-tête, alerte, stepper ─────────────────────────────── */
.cockpit { padding: 18px 22px 14px; margin-bottom: 20px; }
.cockpit-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--ghost-outline-solid); }
.cockpit-id { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cockpit-id .numero { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pill.live .pill-dot { animation: pulse 1.6s ease-in-out infinite; }
.pill.enregistre { background: var(--surface-container-low); color: var(--on-surface-variant); border-color: var(--ghost-outline-solid); }
.pill.enregistre .pill-dot { background: var(--on-surface-muted); }
.pill.transit { background: var(--secondary-light); color: var(--secondary); border-color: rgba(0,99,153,0.25); }
.pill.transit .pill-dot { background: var(--secondary); }
.pill.arrive { background: var(--primary-fixed); color: var(--primary); border-color: rgba(0,209,102,0.4); }
.pill.arrive .pill-dot { background: var(--primary-bright); }
.pill.remis { background: var(--success-light); color: var(--primary); border-color: rgba(0,109,50,0.25); }
.pill.remis .pill-dot { background: var(--primary-container); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.lot { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; background: var(--primary-container); box-shadow: 0 1px 3px rgba(0,0,0,0.12); white-space: nowrap; }
.lot svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 2.5; }
.lot.transit { background: var(--secondary); }
.lot.enregistre { background: var(--on-surface-variant); }
.lot.partiel { background: #fff4e0; color: #8a5a00; border: 1px solid rgba(138,90,0,0.25); box-shadow: none; }

.btn-ghost { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; background: var(--surface-low); border: 1px solid var(--ghost-outline-solid); border-radius: 0.5rem; font-family: var(--font-body); font-size: 12.5px; font-weight: 500; color: var(--on-surface-variant); cursor: pointer; transition: color 0.15s, background 0.15s; }
.btn-ghost:hover { color: var(--primary); background: var(--surface-mid); }
.btn-ghost svg { width: 15px; height: 15px; stroke: currentColor; }

.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 20px; padding: 10px 16px; border-radius: 0.6rem; border: 1px solid; }
.alert-msg { display: flex; align-items: center; gap: 10px; min-width: 0; }
.alert-emoji { font-size: 18px; line-height: 1; flex-shrink: 0; }
.alert p { font-size: 13.5px; color: var(--on-surface); }
.alert p strong { font-weight: 600; }
.alert p u { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.alert-sub { display: block; font-size: 12px; color: var(--on-surface-variant); margin-top: 2px; }
.alert-badge { flex-shrink: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 0.3rem; background: rgba(255,255,255,0.8); border: 1px solid; white-space: nowrap; }
.alert.enregistre { background: var(--surface-container-low); border-color: var(--ghost-outline-solid); }
.alert.enregistre p strong, .alert.enregistre .alert-badge { color: var(--on-surface-variant); }
.alert.enregistre .alert-badge { border-color: var(--ghost-outline-solid); }
.alert.transit { background: rgba(0,99,153,0.05); border-color: rgba(0,99,153,0.2); }
.alert.transit p strong, .alert.transit .alert-badge { color: var(--secondary); }
.alert.transit .alert-badge { border-color: rgba(0,99,153,0.25); }
.alert.arrive { background: rgba(0,109,50,0.05); border-color: rgba(0,109,50,0.2); }
.alert.arrive p strong, .alert.arrive .alert-badge { color: var(--primary); }
.alert.arrive .alert-badge { border-color: rgba(0,109,50,0.2); }
.alert.remis { background: var(--success-light); border-color: rgba(0,109,50,0.2); }
.alert.remis p strong, .alert.remis .alert-badge { color: var(--primary); }
.alert.remis .alert-badge { border-color: rgba(0,109,50,0.2); }

/* Stepper horizontal ; défile latéralement quand la place manque */
.stepper-scroll { overflow-x: auto; padding: 4px 0 6px; scrollbar-width: thin; }
.stepper { display: flex; align-items: flex-start; min-width: 560px; padding: 0 4px; }
.step { display: flex; flex-direction: column; align-items: center; text-align: center; width: 116px; flex-shrink: 0; }
.step-dot { position: relative; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 7px; }
.step-dot svg { width: 15px; height: 15px; stroke-width: 2.5; }
.step.done .step-dot { background: var(--primary-container); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.step.done .step-dot svg { stroke: #fff; }
.step.active .step-dot { background: var(--primary-bright); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,209,102,0.45); }
.step.active .step-dot svg { stroke: var(--primary); }
.step.active .step-dot::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; background: var(--primary-bright); opacity: 0.3; animation: ping 1.6s cubic-bezier(0,0,0.2,1) infinite; }
@keyframes ping { 0% { transform: scale(0.7); opacity: 0.45; } 80%, 100% { transform: scale(1.35); opacity: 0; } }
.step.pending { opacity: 0.6; }
.step.partial .step-dot { background: var(--primary-fixed-dim); color: #fff; }
.step.partial .step-dot svg { stroke: #fff; }
.step.partial .step-label { color: var(--on-surface-variant); }
.step.pending .step-dot { background: var(--surface-container-low); border: 1px solid var(--ghost-outline-solid); }
.step.pending .step-dot svg { stroke: var(--on-surface-muted); }
.step-label { font-size: 12px; font-weight: 600; color: var(--on-surface); line-height: 1.25; }
.step.active .step-label { color: var(--primary); font-weight: 700; }
.step-sub { font-size: 11px; color: var(--on-surface-muted); margin-top: 1px; line-height: 1.25; }
.step.active .step-sub { color: var(--primary-container); font-weight: 500; }
.step-line { flex: 1; height: 3px; margin-top: 13.5px; min-width: 24px; border-radius: 2px; background: var(--ghost-outline-solid); }
.step-line.done { background: var(--primary-container); }

/* ── Grille 5 / 7 ───────────────────────────────────────────────────── */
.suivi-grid { display: grid; grid-template-columns: 5fr 7fr; grid-template-rows: auto 1fr; gap: 20px; align-items: start; }
.col-left { grid-column: 1; grid-row: 1; }
.col-right { grid-column: 2; grid-row: 1 / span 2; }
.suivi-grid > .help-card { grid-column: 1; grid-row: 2; margin-top: -4px; }
@media (max-width: 900px) {
  .suivi-grid { grid-template-columns: 1fr; grid-template-rows: none; }
  .col-left, .col-right, .suivi-grid > .help-card { grid-column: auto; grid-row: auto; margin-top: 0; }
}

/* Itinéraire */
.route { position: relative; display: flex; flex-direction: column; gap: 14px; }
.route::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--ghost-outline-solid); }
.route-pt { position: relative; padding-left: 28px; }
.route-pt::before { content: ''; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; background: var(--primary-container); box-shadow: 0 0 0 1px var(--ghost-outline-solid); }
.route-pt.dest::before { background: var(--primary-bright); }
.route-k { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--on-surface-muted); }
.route-v { font-size: 14px; font-weight: 600; }
.route-s { font-size: 12px; color: var(--on-surface-variant); }
.route-s strong { color: var(--on-surface); font-weight: 600; }

/* Détail du colisage & marchandises */
.strip { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 10px 8px; border-radius: 0.5rem; background: var(--surface-low); border: 1px solid var(--ghost-outline); margin-bottom: 12px; }
.strip > div { text-align: center; min-width: 0; }
.strip > div + div { border-left: 1px solid var(--ghost-outline-solid); }
.strip-k { font-size: 10px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--on-surface-muted); }
.strip-v { font-family: var(--font-display); font-size: 16px; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.strip-v.primary { color: var(--primary); }
.strip-v.sm { font-family: var(--font-body); font-size: 12.5px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.parcels { display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.parcel { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 0.5rem; background: var(--surface-lowest); border: 1px solid var(--ghost-outline-solid); transition: border-color 0.15s; }
.parcel:hover { border-color: rgba(0,109,50,0.4); }
.parcel-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.parcel-n { width: 26px; height: 26px; border-radius: 0.35rem; background: rgba(0,82,36,0.1); color: var(--primary); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.parcel-txt { min-width: 0; }
.parcel-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.parcel-code { font-family: var(--font-data); font-size: 10.5px; color: var(--on-surface-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.parcel-r { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.parcel-kg { font-size: 12.5px; font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 0.25rem; border: 1px solid; white-space: nowrap; }
.chip svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 3; }
.chip.enregistre { background: var(--surface-container-low); color: var(--on-surface-variant); border-color: var(--ghost-outline-solid); }
.chip.transit { background: var(--secondary-light); color: var(--secondary); border-color: rgba(0,99,153,0.25); }
.chip.arrive { background: var(--primary-fixed); color: var(--primary); border-color: rgba(0,109,50,0.2); }
.chip.remis { background: var(--primary-container); color: #fff; border-color: var(--primary-container); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--ghost-outline-solid); font-size: 11px; color: var(--on-surface-muted); }
.card-foot span:first-child { display: inline-flex; align-items: center; gap: 5px; }
.card-foot svg { width: 13px; height: 13px; stroke: var(--primary); }
.card-foot .mono { font-family: var(--font-data); font-weight: 700; color: var(--primary); }

/* Aide */
.help-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 0.85rem; background: var(--surface-lowest); border: 1px solid rgba(0,109,50,0.25); box-shadow: 0 4px 20px -2px rgba(11,28,48,0.05); text-decoration: none; color: inherit; transition: border-color 0.15s; }
.help-card:hover { border-color: var(--primary-container); }
.help-left { display: flex; align-items: center; gap: 12px; }
.help-ico { width: 34px; height: 34px; border-radius: 0.5rem; background: var(--success-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.help-ico svg { width: 18px; height: 18px; stroke: var(--primary-container); }
.help-t { font-size: 12.5px; font-weight: 600; color: var(--on-surface); }
.help-card:hover .help-t { color: var(--primary); }
.help-s { font-size: 11.5px; color: var(--on-surface-muted); }
.help-arrow { width: 16px; height: 16px; stroke: var(--on-surface-muted); flex-shrink: 0; }
.help-card:hover .help-arrow { stroke: var(--primary); }

/* Historique */
.hist { position: relative; padding-left: 26px; }
.hist::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 12px; width: 2px; background: var(--ghost-outline-solid); }
.hist-item { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.hist-item + .hist-item { margin-top: 18px; }
.hist-item::before { content: ''; position: absolute; left: -26px; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; background: var(--primary-container); box-shadow: 0 0 0 1px var(--ghost-outline-solid); }
.hist-item.current::before { background: var(--primary-bright); box-shadow: 0 0 8px rgba(0,209,102,0.6); }
.hist-item.pending { opacity: 0.45; }
.hist-item.partial::before { background: var(--primary-fixed-dim); }
.hist-item.partial .hist-title h4 { color: var(--on-surface-variant); }
.hist-item.pending::before { background: var(--ghost-outline-solid); }
.hist-body { flex: 1; min-width: 0; }
.hist-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hist-title h4 { font-size: 14px; font-weight: 600; }
.hist-item.current .hist-title h4 { font-weight: 700; }
.tag { display: inline-flex; align-items: center; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 0.25rem; border: 1px solid; white-space: nowrap; }
.tag.sms { background: var(--primary-fixed); color: var(--primary); border-color: rgba(0,109,50,0.2); }
.tag.sms.done { background: var(--surface-low); color: var(--on-surface-muted); border-color: var(--ghost-outline-solid); font-weight: 500; }
.tag.part { background: #fff4e0; color: #8a5a00; border-color: rgba(138,90,0,0.25); }
.hist-desc { font-size: 12.5px; color: var(--on-surface-variant); margin-top: 2px; }
.hist-loc { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--on-surface-muted); margin-top: 3px; }
.hist-loc svg { width: 11px; height: 11px; stroke: currentColor; }
.hist-when { text-align: right; flex-shrink: 0; }
.hist-when .d { display: block; font-family: var(--font-display); font-size: 12px; font-weight: 600; }
.hist-when .t { display: block; font-family: var(--font-data); font-size: 11px; color: var(--on-surface-muted); }
.hist-when .soon { font-size: 12px; font-style: italic; color: var(--on-surface-muted); }

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .track-bar.compact { flex-direction: column; align-items: stretch; gap: 10px; }
  .track-bar.compact .track-form { max-width: none; }
  .cockpit { padding: 16px; }
  .cockpit-id .numero { font-size: 22px; }
  .alert { align-items: flex-start; }
  .alert-badge { display: none; }
  .strip-v { font-size: 14px; }
  .card-head .muted { display: none; }
  .hist-item { flex-direction: column; gap: 4px; }
  .hist-when { text-align: left; display: flex; gap: 6px; align-items: baseline; }
}

@media print {
  .track-bar, .help-card, .cockpit-actions { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
}
