/* ================================================================
   courriers-liste.css — v2
   Toolbar, pagination, toggle vue, recherche avancée, table, timeline
   ================================================================ */

/* ── Toolbar ──────────────────────────────────────────────────── */
.courriers-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.courriers-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}
.courriers-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Bouton navigation ────────────────────────────────────────── */
.btn-nav-modeles {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1.5px solid var(--fv-night-700, #1b3449);
  background: var(--fv-night-100, #dbe4ec);
  color: var(--fv-night-800, #0f2233);
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.1s;
  white-space: nowrap;
}
.btn-nav-modeles:hover {
  background: #e0e7ff;
  box-shadow: 0 3px 10px rgba(27, 52, 73, 0.2);
  transform: translateY(-1px);
}
.btn-shop-modeles {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transition:
    box-shadow 0.15s,
    transform 0.1s;
  white-space: nowrap;
}
.btn-shop-modeles:hover {
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
}

/* ── Toggle de vue ────────────────────────────────────────────── */
.view-toggle {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
}
.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.7rem;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 1rem;
  transition:
    background 0.15s,
    color 0.15s;
  line-height: 1;
}
.view-toggle-btn + .view-toggle-btn {
  border-left: 1px solid #e2e8f0;
}
.view-toggle-btn.active {
  background: #6366f1;
  color: #fff;
}
.view-toggle-btn:hover:not(.active) {
  background: #e2e8f0;
  color: #1e293b;
}

/* ── Recherche avancée ────────────────────────────────────────── */
.search-advanced {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
}
.search-advanced-input {
  flex: 1;
  min-width: 160px;
  padding: 0.42rem 0.8rem 0.42rem 2rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E")
    no-repeat 8px center;
  color: #1e293b;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.search-advanced-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.search-advanced-input::placeholder {
  color: #94a3b8;
  font-size: 0.85rem;
}
.search-advanced-select {
  padding: 0.42rem 0.7rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
  transition: border-color 0.15s;
}
.search-advanced-select:focus {
  outline: none;
  border-color: #6366f1;
}
.search-results-count {
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: nowrap;
  font-style: italic;
}

/* ── Contrôle taille de page ──────────────────────────────────── */
.pagination-page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: #64748b;
}
.pagination-page-size-select {
  padding: 0.28rem 0.5rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.82rem;
  background: #fff;
  color: #1e293b;
  cursor: pointer;
}
.pagination-page-size-select:focus {
  outline: none;
  border-color: #6366f1;
}

/* ── Vue Table ────────────────────────────────────────────────── */
.courriers-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  background: #fff;
}
.courriers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.courriers-table thead {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}
.courriers-table th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  white-space: nowrap;
}
.courriers-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}
.courriers-table tbody tr {
  transition: background 0.1s;
}
.courriers-table tbody tr:hover {
  background: #f8fafc;
}
.courriers-table tbody tr:last-child td {
  border-bottom: none;
}

.col-titre {
  font-weight: 600;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-statut {
  white-space: nowrap;
}
.col-users {
  color: #64748b;
  font-size: 0.82rem;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-pdf {
  text-align: center;
  font-size: 1rem;
}
.col-date {
  white-space: nowrap;
  color: #64748b;
  font-size: 0.82rem;
}
.col-actions {
  white-space: nowrap;
  text-align: right;
}

.table-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  font-size: 0.85rem;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
  margin-left: 4px;
}
.table-action-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}
.table-action-btn.danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* ── Badges statut ────────────────────────────────────────────── */
.badge-statut {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-brouillon {
  background: #fef9c3;
  color: #854d0e;
}
.badge-envoye {
  background: #dcfce7;
  color: #166534;
}
.badge-archive {
  background: #f1f5f9;
  color: #475569;
}

/* ── Vue Timeline ─────────────────────────────────────────────── */
.courriers-timeline {
  position: relative;
  padding-left: 32px;
}
.courriers-timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #6366f1 0%, #e2e8f0 100%);
  border-radius: 1px;
}
.timeline-month {
  margin-bottom: 28px;
}
.timeline-month-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  margin-left: -32px;
}
.timeline-month-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #6366f1;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #6366f1;
  flex-shrink: 0;
}
.timeline-month-text {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6366f1;
  background: #f0f0ff;
  padding: 3px 10px;
  border-radius: 999px;
}
.timeline-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Carte dans la timeline : plus compacte, avec fil */
.timeline-card {
  position: relative;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition:
    box-shadow 0.15s,
    transform 0.1s;
}
.timeline-card:hover {
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
  transform: translateX(2px);
}
.timeline-card::before {
  content: "";
  position: absolute;
  left: -23px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2px solid #fff;
}
.timeline-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.timeline-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1e293b;
  flex: 1;
  min-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.timeline-card-date {
  font-size: 0.78rem;
  color: #94a3b8;
}
.timeline-card-users {
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.timeline-card-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

/* ── Pagination ───────────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.pagination-info {
  font-size: 0.82rem;
  color: #64748b;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pagination-page-numbers {
  display: flex;
  gap: 3px;
}
.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.pagination-btn:hover:not(:disabled) {
  border-color: #6366f1;
  color: #6366f1;
  background: #f0f0ff;
}
.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pagination-btn.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
  cursor: default;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
  .courriers-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .pagination-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .col-pdf,
  .col-users {
    display: none;
  }
  .courriers-timeline {
    padding-left: 20px;
  }
  .timeline-month-label {
    margin-left: -20px;
  }
  .timeline-card::before {
    left: -14px;
  }
}

/* ── Lien PDF dans la table ──────────────────────────────────── */
.pdf-table-link {
  text-decoration: none;
  font-size: 1.1rem;
  display: inline-block;
  transition: transform 0.15s;
}
.pdf-table-link:hover {
  transform: scale(1.2);
}

/* ── Colonne triable ─────────────────────────────────────────── */
.courriers-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.courriers-table th.sortable:hover {
  color: #6366f1;
}

/* ── Date inputs dans search-advanced ───────────────────────── */
.search-advanced input[type="date"] {
  padding: 0.42rem 0.7rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  background: #fff;
  color: #1e293b;
  transition: border-color 0.15s;
}
.search-advanced input[type="date"]:focus {
  outline: none;
  border-color: #6366f1;
}
