/* Surcharges par-dessus pico.min.css — palette et langage visuel repris de
   la maquette fournie (cartes blanches, rouge de marque, badges pilule). */

:root {
  --brand: rgb(216, 0, 21);
  --brand-light: rgba(216, 0, 21, 0.10);
  --brand-dark: rgb(184, 0, 15);
  --success: #1a7a4a;
  --success-light: #e6f5ed;
  --warn: #b45309;
  --warn-light: #fef3c7;
  --danger: #991b1b;
  --danger-light: #fee2e2;
  --info: #1e40af;
  --info-light: #dbeafe;
  --card-radius: 10px;
}

/* Reteinte Pico en rouge de marque : tous les boutons/liens par défaut
   (Suivant, Enregistrer, Télécharger...) en héritent sans avoir à
   surcharger chaque composant un par un. */
:root {
  --pico-primary: var(--brand);
  --pico-primary-background: var(--brand);
  --pico-primary-border: var(--brand);
  --pico-primary-hover: var(--brand-dark);
  --pico-primary-hover-background: var(--brand-dark);
  --pico-primary-hover-border: var(--brand-dark);
  --pico-primary-focus: rgba(216, 0, 21, 0.25);
  --pico-primary-inverse: #fff;
  --pico-primary-underline: var(--brand);
  --pico-primary-hover-underline: var(--brand-dark);
}

body {
  background: #f3f6fb;
  min-height: 100vh;
   font-family: system-ui, -apple-system, sans-serif;
}

.container {
  max-width: 90%;
}

/* ── Bandeau applicatif (wizard + backoffice) : logo seul ── */
.app-header {
  background: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 0.75rem;
}

.app-header .logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
}

.app-header .logo span {
  color: var(--brand);
}

/* ── Ligne d'actions de page (Backoffice/Nouvelle livraison, Se déconnecter),
   sous le bandeau plutôt que dedans — compacte, calée à droite. ── */
.page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  max-width: 90%;
  margin: 0 auto 1rem;
}

.page-actions form {
  margin: 0;
}

.page-actions a[role="button"],
.page-actions button {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  margin: 0;
  width: auto;
}

/* ── Cartes (sections du backoffice, blocs du wizard) ── */
.card {
  background: #fff;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--card-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pico-muted-color);
  margin-bottom: 0.75rem;
}

#detail-modal > article {
  width: 100%;
  max-width: 640px;
  border-radius: var(--card-radius);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stats-row article {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--card-radius);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pico-muted-color);
  margin: 0 0 0.3rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
}

/* ── Tableau des livraisons, dans l'esprit compact/lisible de la référence ── */
.deliveries-table {
  margin-bottom: 0;
  font-size: 0.85rem;
}

.deliveries-table thead th {
  background: #f8fafc;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.deliveries-table tbody td {
  padding: 0.55rem 0.9rem;
  vertical-align: middle;
}

.deliveries-table tbody tr:last-child td {
  border-bottom: 0;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.action-btn {
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  margin: 0;
  width: auto;
  white-space: nowrap;
}

.filters-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filters-row select {
  flex: 1;
  min-width: 140px;
}

.filters-row input[type="search"] {
  flex: 2;
  min-width: 180px;
}

.truncate {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.align-right {
  text-align: right;
}

.muted {
  color: var(--pico-muted-color);
}

/* ── Badges pilule, mêmes teintes que les puces "stat-chip" de la maquette ── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-en_attente {
  background: var(--warn-light);
  color: var(--warn);
}

.badge-planifiee {
  background: var(--info-light);
  color: var(--info);
}

.badge-livree {
  background: var(--success-light);
  color: var(--success);
}

.badge-annulee {
  background: var(--danger-light);
  color: var(--danger);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* ── Notices, mêmes teintes que les badges pour rester cohérent ── */
.notice {
  padding: 0.6rem 0.9rem;
  border-radius: var(--pico-border-radius);
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.notice-ok {
  background: var(--success-light);
  color: var(--success);
}

.notice-error {
  background: var(--danger-light);
  color: var(--danger);
}

.notice-warning {
  background: var(--warn-light);
  color: var(--warn);
}

.actions-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.planning-block {
  margin: 1rem 0;
  padding: 0.75rem;
  border: 1px dashed var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
}

.planning-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.planning-form input,
.planning-form select {
  margin: 0;
  width: auto;
  flex: 1;
  min-width: 140px;
}

.planning-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
}

/* --- Wizard --- */

.wizard-card {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--card-radius);
  padding: 1.5rem;
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.wizard-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 1.25rem;
}

.wizard-dot {
  height: 4px;
  flex: 1;
  border-radius: 99px;
  background: #e5e7eb;
  transition: background 0.25s;
}

.wizard-dot-done {
  background: var(--brand);
}

.wizard-step {
  min-height: 220px;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
}

.btn-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn-row button {
  flex: 1;
  background-color: #e5e7eb !important;
  border-color: #d1d5db !important;
  color: #374151 !important;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-row button:hover {
  background-color: #d1d5db !important;
  border-color: #9ca3af !important;
}

.btn-row button.sel {
  background-color: var(--brand) !important;
  border-color: var(--brand-dark) !important;
  color: #ffffff !important;
}

.btn-row button.sel:hover {
  background-color: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
}

.tours-counter {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.25rem;
}

.tours-counter button {
  width: 2.5rem;
  padding: 0.25rem;
}

.recap-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--pico-muted-border-color);
  padding-top: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.required {
  color: var(--brand);
}

.hint-questions {
  font-size: 0.85rem;
  margin-top: -0.5rem;
}

.shortcut-btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  margin: 0.4rem 0 0.5rem;
  width: auto;
}

.client-ok-row {
  margin-top: 1rem;
  font-weight: 600;
}

[x-cloak] {
  display: none !important;
}

.address-autocomplete {
  position: relative;
}

#adresse-mount {
  margin-bottom: 0.75rem;
}

.wizard-abandon {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
}
