/* Tableau de bord chauffeur – Premium SaaS */

.dashboard {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
}

.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.2));
}

.dash-header__info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dash-header__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-header__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dash-header__avatar-placeholder {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  line-height: 1;
}

.dash-header__name {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.dash-header__status.approved { background: rgba(34, 197, 94, 0.2); color: #166534; }
.dash-header__status.pending { background: rgba(59, 130, 246, 0.2); color: #1e40af; }
.dash-header__status.rejected { background: rgba(239, 68, 68, 0.2); color: #991b1b; }
.dash-header__status.draft { background: rgba(234, 179, 8, 0.2); color: #854d0e; }

/* Grille hero : 4 cartes premium */
.dash-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .dash-hero {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 960px) {
  .dash-hero {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1200px) {
  .dash-hero {
    grid-template-columns: repeat(4, 1fr);
  }
}

.partner-dates {
  font-size: 0.85rem;
  margin: 0.5rem 0;
}
.partner-dates p { margin: 0.2rem 0; }

.card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card__msg {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.availability-toggle--compact {
  margin-top: 0.5rem;
}

.availability-toggle--compact .availability-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.revenus-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.revenus-kpis .kpi {
  font-size: 1.5rem;
}

.sparkline-wrap {
  height: 40px;
  margin: 0.75rem 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.sparkline {
  width: 100%;
  height: 100%;
  color: var(--accent, #38bdf8);
}
.sparkline path {
  stroke: currentColor;
  stroke-width: 1.5px;
  fill: none;
}

/* Cartes du hero : thème sombre pour lisibilité sur fond navy */
.dash-hero .card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text, #e5e7eb);
}
.dash-hero .card .card__title {
  color: var(--text, #e5e7eb);
}
.dash-hero .card .card__subtitle {
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
}
.dash-hero .card .card__icon {
  color: var(--text-muted, #94a3b8);
}
.dash-hero .card .muted {
  color: var(--text-muted, #94a3b8);
}
.dash-hero .card .kpi {
  color: var(--text, #e5e7eb);
}
.dash-hero .card .kpi--accent {
  color: var(--accent, #38bdf8);
}
.dash-hero .card .btn-secondary {
  color: var(--text, #e5e7eb);
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.06);
}
.dash-hero .card .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent, #38bdf8);
  color: var(--accent, #38bdf8);
}
.dash-hero .card .chip.approved {
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
}
.dash-hero .card .chip.pending {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}
.dash-hero .card .chip.rejected {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.dash-hero .card .chip.missing {
  background: rgba(234, 179, 8, 0.25);
  color: #fde047;
}

.doc-list--compact {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.doc-list--compact li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  gap: 0.5rem;
}

.doc-list--compact li:last-child {
  border-bottom: none;
}

/* Noms des documents : contraste fort pour une lecture claire */
.doc-list--compact li > span:first-child {
  color: var(--text, #e5e7eb);
  font-weight: 500;
}

.dash-card__title-icon {
  display: inline-flex;
  align-items: center;
  opacity: 0.7;
  margin-right: 0.35rem;
}

.dash-card__title-icon svg {
  flex-shrink: 0;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

/* Grid sections Missions / Notifications / Activité */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .dash-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .dash-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .dash-card--missions { grid-column: 1 / -1; }
}

.dash-kyc__btn { display: inline-block; margin-top: 0.5rem; }

/* Cards (harmonisées avec .card premium) */
.dash-card {
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.25));
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.dash-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dash-card__link {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent, #38bdf8);
  text-decoration: none;
}

.dash-card__link:hover {
  text-decoration: underline;
}

.dash-card__subtitle {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 1rem 0 0.5rem;
  color: var(--text-muted, #9ca3af);
}

.dash-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent, #38bdf8);
  color: #020617;
}

/* Disponibilité toggle */
.availability-toggle {
  display: flex;
  gap: 0.5rem;
}

.availability-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.3));
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted, #9ca3af);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.availability-btn:hover {
  border-color: var(--accent, #38bdf8);
  color: var(--text, #e5e7eb);
}

.availability-btn[aria-pressed="true"] {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent, #38bdf8);
  color: var(--accent, #38bdf8);
}

/* Missions tabs */
.dash-missions__tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.2));
}
.dash-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted, #9ca3af);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.dash-tab:hover {
  color: var(--text, #e5e7eb);
}
.dash-tab--active,
.dash-tab[aria-selected="true"] {
  color: var(--accent, #38bdf8);
  border-bottom-color: var(--accent, #38bdf8);
}
.dash-missions__panels {
  min-height: 120px;
}
.dash-missions__panel[hidden] {
  display: none;
}

/* Missions */
.mission-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mission-item {
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.25));
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.mission-item:last-child {
  margin-bottom: 0;
}

.mission-item__info {
  flex: 1;
  min-width: 140px;
}

.mission-item__route {
  font-size: 0.95rem;
  font-weight: 500;
}

.mission-item__meta {
  font-size: 0.8rem;
  color: var(--text-muted, #9ca3af);
  margin-top: 0.2rem;
}

.mission-item__actions {
  display: flex;
  gap: 0.5rem;
}

.mission-item__actions .btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.mission-item--accepted .mission-item__route { color: #4ade80; }
.mission-item--refused .mission-item__route { color: var(--text-muted); text-decoration: line-through; }

.empty-state {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted, #9ca3af);
  font-size: 0.9rem;
}

/* Revenus */
.revenus-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.revenus-total {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  text-align: center;
}

.revenus-total__val {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent, #38bdf8);
}

.revenus-total__lbl {
  font-size: 0.8rem;
  color: var(--text-muted, #9ca3af);
}

.paiement-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.paiement-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 0.9rem;
}

.paiement-item:last-child {
  border-bottom: none;
}

.paiement-item__date {
  color: var(--text-muted, #9ca3af);
}

.paiement-item__amount {
  font-weight: 600;
  color: #4ade80;
}

/* Notifications */
.notif-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notif-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 0.9rem;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item__text {
  color: var(--text, #e5e7eb);
}

.notif-item__time {
  font-size: 0.8rem;
  color: var(--text-muted, #9ca3af);
  margin-top: 0.2rem;
}
