/* ============================================================================
   GPP Flyer — v7 : suivi de statut des commandes d'impression
   Chargé APRÈS app.css / v5.css / v6.css. N'écrase aucune règle existante,
   ajoute uniquement la couche de présentation des cartes de commande
   (badge coloré, barre de progression 5 étapes, historique dépliable).
   Identité : navy #0A1628 + orange #F59E0B.
   ============================================================================ */

/* ---------- Badge de statut ---------- */
.order-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: .2px;
  flex: 0 0 auto;
}
.st-nouveau    { background: #eef1f6; color: #64748b; }
.st-confirme   { background: #e0edff; color: #2563eb; }
.st-production { background: #fef3d8; color: #d97706; }
.st-pret       { background: #d9f5e8; color: #059669; }
.st-livre      { background: #0A1628; color: #ffffff; }
.st-annule     { background: #fde3e3; color: #dc2626; }

/* ---------- Carte de commande ---------- */
.order-card {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 10px;
  background: #fff;
  text-align: left;
}
.order-head { display: flex; align-items: flex-start; gap: 10px; }
.order-head .grow { flex: 1; min-width: 0; }
.order-title { font-weight: 700; color: var(--ink); font-size: 13.5px; }
.order-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.order-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Barre de progression (5 étapes) ---------- */
.order-progress {
  display: flex;
  margin: 14px 0 6px;
  direction: ltr; /* la flèche de progression reste lisible en RTL */
}
.op-step {
  flex: 1;
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.op-step i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e5e9f0;
  border: 2px solid #e5e9f0;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}
.op-step span {
  font-size: 9.5px;
  font-weight: 700;
  color: #9aa6b6;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.op-step:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 6px;
  left: -50%;
  right: 50%;
  height: 3px;
  background: #e5e9f0;
  border-radius: 2px;
}
.op-step.op-done i { background: #0A1628; border-color: #0A1628; }
.op-step.op-done::before { background: #0A1628; }
.op-step.op-done span { color: #0A1628; }
.op-step.op-current i {
  background: #F59E0B;
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .20);
}
.op-step.op-current span { color: #0A1628; }
.order-progress.cancelled .op-step i { background: #f3d1d1; border-color: #f3d1d1; }
.order-progress.cancelled .op-step::before { background: #f3d1d1; }
.order-progress.cancelled .op-step span { color: #b7c0cd; }

/* ---------- Actions ---------- */
.order-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.order-actions .btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Détail dépliable (historique) ---------- */
.order-toggle {
  border: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  margin-top: 9px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
}
.order-toggle span { transition: transform .15s; font-size: 10px; }
.order-toggle:hover { color: #F59E0B; }
.order-detail {
  margin-top: 9px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.oh-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 12px; }
.oh-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.oh-status { font-weight: 700; color: var(--ink); }
.oh-by { font-size: 11px; color: var(--muted); }
.oh-at { font-size: 11px; color: var(--muted); white-space: nowrap; margin-left: auto; }

/* ---------- Sous-titre de section admin ---------- */
.orders-subtitle {
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  margin: 16px 0 10px;
  letter-spacing: -.2px;
}

/* RTL : la carte revient à une lecture droite-à-gauche pour les textes */
[dir="rtl"] .order-card { text-align: right; }
[dir="rtl"] .oh-at { margin-left: 0; margin-right: auto; }

/* état final : plus d'actions, juste un libellé */
.order-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #10b981;
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  padding: 7px 12px;
}
.order-card[data-oid] .order-done:has(+ *) { color: #10b981; }
