/* ============================================
   TAF - Espace Chauffeur (complement a taf.css)
   Objectif : lisible d'un coup d'oeil, utilisable au volant/en mobilite.
   ============================================ */

.ec-header { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.ec-welcome { margin:4px 0 0; color:#4a5cff; font-weight:600; }
.ec-logout { margin:0; white-space:nowrap; }

/* --- Statistiques du mois --- */
.ec-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
            gap:12px; margin-bottom:20px; }
.ec-stat { background:#fff; border-radius:12px; padding:14px 16px;
           box-shadow:0 2px 8px rgba(0,0,0,.06); text-align:center; }
.ec-stat-val { font-size:1.5rem; font-weight:700; color:#4a5cff; line-height:1.2; }
.ec-stat-lbl { font-size:.8rem; color:#6b7280; margin-top:4px; }
.ec-stat.is-warn .ec-stat-val { color:#d97706; }

/* --- Onglets --- */
.ec-tabs { display:flex; gap:6px; margin-bottom:16px; flex-wrap:wrap; }
.ec-tab { border:none; background:#f3f4f6; color:#374151; padding:10px 16px;
          border-radius:10px 10px 0 0; font-size:.95rem; font-weight:600;
          cursor:pointer; transition:background .15s, color .15s; }
.ec-tab:hover { background:#e5e7eb; }
.ec-tab.is-active { background:#4a5cff; color:#fff; }
.ec-badge { display:inline-block; min-width:20px; margin-left:6px; padding:1px 6px;
            background:#ef4444; color:#fff; border-radius:10px; font-size:.75rem; }
.ec-tab.is-active .ec-badge { background:#fff; color:#ef4444; }

/* --- Carte de course --- */
.ec-card { background:#fff; border-radius:12px; padding:14px 16px; margin-bottom:12px;
           box-shadow:0 2px 8px rgba(0,0,0,.06); border-left:5px solid #4a5cff; }
.ec-card.is-absence { border-left-color:#9ca3af; background:#f9fafb; }
.ec-card.is-done    { border-left-color:#22c55e; }
.ec-card.is-cancel  { border-left-color:#ef4444; opacity:.7; }

.ec-card-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.ec-time { font-size:1.25rem; font-weight:700; color:#111827; white-space:nowrap; }
.ec-time small { display:block; font-size:.72rem; font-weight:500; color:#6b7280; }
.ec-client { font-weight:600; font-size:1.05rem; color:#111827; }
.ec-meta { font-size:.85rem; color:#6b7280; margin-top:2px; }
.ec-route { margin-top:10px; font-size:.92rem; color:#374151; line-height:1.5; }
.ec-route span { color:#9ca3af; }
.ec-price { font-weight:700; color:#4a5cff; white-space:nowrap; }

.ec-tag { display:inline-block; padding:2px 9px; border-radius:20px;
          font-size:.75rem; font-weight:600; }
.ec-tag-confirm { background:#eff6ff; color:#1d4ed8; }
.ec-tag-done    { background:#f0fdf4; color:#15803d; }
.ec-tag-cancel  { background:#fef2f2; color:#b91c1c; }
.ec-tag-absence { background:#f3f4f6; color:#4b5563; }
.ec-tag-quit    { background:#fffbeb; color:#b45309; }

/* --- Actions --- */
.ec-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px;
              padding-top:12px; border-top:1px solid #f3f4f6; }
.ec-act { border:1px solid #d1d5db; background:#fff; color:#374151;
          padding:7px 13px; border-radius:8px; font-size:.85rem; font-weight:600;
          cursor:pointer; transition:all .15s; }
.ec-act:hover { background:#f9fafb; border-color:#9ca3af; }
.ec-act-main { background:#4a5cff; border-color:#4a5cff; color:#fff; }
.ec-act-main:hover { background:#3b4ae0; border-color:#3b4ae0; }
.ec-act-danger:hover { background:#fef2f2; border-color:#ef4444; color:#b91c1c; }
.ec-act:disabled { opacity:.5; cursor:not-allowed; }

/* --- Divers --- */
.ec-day { font-size:.9rem; font-weight:700; color:#6b7280; text-transform:uppercase;
          letter-spacing:.04em; margin:20px 0 10px; }
.ec-empty { text-align:center; padding:30px 20px; color:#6b7280; background:#fff;
            border-radius:12px; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.ec-hint { margin-top:10px; padding:10px 12px; background:#eff6ff;
           border-left:4px solid #3b82f6; border-radius:6px; color:#1e40af;
           font-size:.9rem; text-align:left; }
.ec-search { width:100%; padding:11px 14px; border:1px solid #d1d5db;
             border-radius:10px; font-size:1rem; margin-bottom:14px; }
.ec-note { background:#fffbeb; border-left:4px solid #f59e0b; padding:8px 12px;
           border-radius:6px; font-size:.88rem; color:#92400e; margin-top:10px; }

@media (max-width:600px) {
  .ec-header { flex-direction:column; align-items:flex-start; }
  .ec-tab { flex:1 1 auto; font-size:.85rem; padding:9px 10px; }
  .ec-card-top { flex-direction:column; }
}

.ec-toggle { display:flex; align-items:center; gap:8px; margin:0 0 12px;
             font-size:.88rem; color:#6b7280; cursor:pointer; }
.ec-toggle input { width:16px; height:16px; cursor:pointer; }

/* --- Fenetre d'annulation --- */
.ec-overlay { position:fixed; inset:0; background:rgba(17,24,39,.55); z-index:900;
              display:flex; align-items:center; justify-content:center; padding:16px; }
.ec-modal { background:#fff; border-radius:14px; padding:22px; width:100%;
            max-width:480px; max-height:90vh; overflow:auto;
            box-shadow:0 16px 48px rgba(0,0,0,.28); }
.ec-modal h3 { margin:0 0 16px; font-size:1.15rem; color:#111827; }
.ec-fieldset { border:1px solid #e5e7eb; border-radius:10px; padding:12px; margin-bottom:16px; }
.ec-legend { display:block; font-size:.78rem; font-weight:700; color:#6b7280;
             text-transform:uppercase; letter-spacing:.04em; margin-bottom:8px; }
.ec-radio { display:flex; gap:10px; align-items:flex-start; padding:8px;
            border-radius:8px; cursor:pointer; }
.ec-radio:hover { background:#f9fafb; }
.ec-radio input { margin-top:3px; width:17px; height:17px; cursor:pointer; }
.ec-radio small { display:block; color:#6b7280; font-size:.8rem; margin-top:2px; }
.ec-lbl { display:block; font-size:.9rem; font-weight:600; color:#374151;
          margin:0 0 5px; }
.ec-lbl em { font-weight:400; color:#6b7280; font-size:.84rem; }
.ec-input { width:100%; padding:10px 12px; border:1px solid #d1d5db; border-radius:9px;
            font-size:.95rem; font-family:inherit; margin-bottom:14px; box-sizing:border-box; }
.ec-input:focus { outline:none; border-color:#4a5cff; box-shadow:0 0 0 3px rgba(74,92,255,.13); }
.ec-modal-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:6px; }

/* --- Onglet Clients --- */
.ec-search { margin-bottom:10px; }
.ec-search .ec-input { margin-bottom:4px; font-size:1rem; }
.ec-search-count { font-size:.85rem; color:#6b7280; display:block; margin-bottom:12px; }
.ec-cl-grid { display:grid; gap:12px; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); }
.ec-cl-card { border:1px solid #e5e7eb; border-radius:12px; padding:14px;
              background:#fff; transition:box-shadow .15s, border-color .15s; }
.ec-cl-card:hover { box-shadow:0 4px 14px rgba(0,0,0,.07); border-color:#c7cbff; }
.ec-cl-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.ec-cl-head h4 { margin:0; font-size:1.02rem; color:#111827; }
.ec-cl-age { font-weight:400; color:#6b7280; font-size:.85rem; }
.ec-cl-line { font-size:.88rem; color:#374151; margin:3px 0; }
.ec-cl-tel { color:#4a5cff; text-decoration:none; font-weight:600; }
.ec-cl-tel:hover { text-decoration:underline; }
.ec-cl-notel { color:#9ca3af; font-style:italic; }
.ec-cl-meta { display:flex; gap:10px; flex-wrap:wrap; font-size:.8rem; color:#6b7280;
              margin:9px 0 0; padding-top:9px; border-top:1px dashed #e5e7eb; }
.ec-cl-rem { font-size:.83rem; color:#92400e; background:#fffbeb; border-radius:7px;
             padding:7px 9px; margin-top:9px; }
.ec-cl-actions { margin-top:11px; }
.ec-tag-aide { background:#eef2ff; color:#3730a3; }
.ec-tag-type { background:#f0fdf4; color:#166534; text-transform:uppercase;
               font-size:.7rem; letter-spacing:.03em; }
/* fiche detaillee */
.ec-cl-detail .ec-modal { max-width:640px; }
.ec-cl-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(88px,1fr));
               gap:8px; margin:14px 0; }
.ec-cl-stat { background:#f9fafb; border-radius:9px; padding:9px; text-align:center; }
.ec-cl-stat b { display:block; font-size:1.25rem; color:#111827; }
.ec-cl-stat span { font-size:.73rem; color:#6b7280; }
.ec-cl-hist { max-height:320px; overflow:auto; margin-top:6px; }
.ec-cl-hist .ec-course { margin-bottom:8px; }

/* Date affichee dans la carte (listes non groupees : fiche client, "A traiter") */
.ec-card-date { font-size:.8rem; font-weight:700; color:#6b7280; text-transform:capitalize;
                margin:-2px 0 9px; padding-bottom:7px; border-bottom:1px solid #f3f4f6;
                letter-spacing:.01em; }
.ec-card-date.is-future { color:#4a5cff; }

/* ---------- Edition du profil client (chauffeur, mobile-first) ----------
   Ajoute le 24.09.2026. Champs a 44px de haut minimum = cible tactile
   confortable, saisie possible d'une seule main dans la voiture. */
.ec-ed-box {
  margin: 14px 0 4px; padding: 14px; border-radius: 12px;
  background: #f8fafc; border: 1px solid #e2e8f0;
}
.ec-ed-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.ec-ed-f { display: flex; flex-direction: column; }
.ec-ed-f.ec-ed-full { margin-top: 10px; }
.ec-ed-f label {
  font-size: .78rem; font-weight: 600; color: #475569; margin-bottom: 4px;
}
.ec-ed-f input, .ec-ed-f select, .ec-ed-f textarea {
  min-height: 44px; padding: 8px 10px; font-size: 1rem;
  border: 1px solid #cbd5e1; border-radius: 9px; background: #fff;
  color: #0f172a; width: 100%; box-sizing: border-box;
}
.ec-ed-f textarea { min-height: 60px; resize: vertical; font-family: inherit; }
.ec-ed-f input:focus, .ec-ed-f select:focus, .ec-ed-f textarea:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
.ec-ed-warn {
  margin-top: 12px; padding: 9px 11px; border-radius: 9px; font-size: .84rem;
  background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
}
.ec-ed-msg { margin-top: 10px; font-size: .88rem; min-height: 20px; }
.ec-ed-ok  { color: #15803d; font-weight: 600; }
.ec-ed-err { color: #b91c1c; font-weight: 600; }
.ec-ed-actions { display: flex; gap: 8px; margin-top: 12px; }
.ec-ed-actions .ec-act { flex: 1; min-height: 46px; font-size: .95rem; }
.ec-act-primary {
  background: #2563eb !important; color: #fff !important; border-color: #2563eb !important;
}
/* Sur petit ecran : une seule colonne, sauf N°/NPA qui restent courts. */
@media (max-width: 560px) {
  .ec-ed-grid { grid-template-columns: 1fr 1fr; }
  .ec-ed-grid > .ec-ed-f:nth-child(1),
  .ec-ed-grid > .ec-ed-f:nth-child(2),
  .ec-ed-grid > .ec-ed-f:nth-child(3),
  .ec-ed-grid > .ec-ed-f:nth-child(6),
  .ec-ed-grid > .ec-ed-f:nth-child(7),
  .ec-ed-grid > .ec-ed-f:nth-child(8) { grid-column: 1 / -1; }
}

/* ---------- Reservation par le chauffeur (mobile-first, 24.09.2026) ---------- */
.ec-rs-step {
  margin: 0 0 16px; padding: 14px; border-radius: 14px;
  background: #fff; border: 1px solid #e2e8f0;
}
.ec-rs-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1rem; color: #0f172a; margin-bottom: 12px;
}
.ec-rs-num {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: #2563eb; color: #fff; font-size: .85rem;
}
.ec-rs-search {
  width: 100%; min-height: 48px; padding: 10px 12px; font-size: 1rem;
  border: 1px solid #cbd5e1; border-radius: 10px; box-sizing: border-box;
}
.ec-rs-search:focus {
  outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}
.ec-rs-results { margin-top: 8px; }
.ec-rs-hit {
  display: block; width: 100%; text-align: left; padding: 10px 12px;
  margin-bottom: 6px; border: 1px solid #e2e8f0; border-radius: 10px;
  background: #f8fafc; cursor: pointer; font-size: .95rem;
}
.ec-rs-hit:hover { background: #eff6ff; border-color: #93c5fd; }
.ec-rs-hit-adr { display: block; font-size: .82rem; color: #64748b; margin-top: 2px; }
.ec-rs-selected {
  padding: 12px; border-radius: 12px; background: #eff6ff; border: 1px solid #bfdbfe;
}
.ec-rs-cl { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.ec-rs-cl-btns { display: flex; flex-direction: column; gap: 6px; }
.ec-rs-cl-btns .ec-act { min-height: 40px; white-space: nowrap; }
.ec-rs-mini {
  margin-top: 6px; padding: 7px 11px; font-size: .82rem; cursor: pointer;
  border: 1px solid #cbd5e1; border-radius: 8px; background: #f1f5f9; color: #334155;
}
.ec-rs-mini:hover { background: #e2e8f0; }
.ec-rs-go { width: 100%; min-height: 50px; margin-top: 14px; font-size: 1rem; }
.ec-rs-recap {
  padding: 14px; border-radius: 12px; background: #f8fafc;
  border: 1px solid #e2e8f0; line-height: 1.75; font-size: .95rem;
}
.ec-rs-prix {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed #cbd5e1;
  font-size: 1.15rem; font-weight: 700; color: #15803d;
}
@media (max-width: 560px) {
  .ec-rs-cl { flex-direction: column; }
  .ec-rs-cl-btns { flex-direction: row; }
  .ec-rs-cl-btns .ec-act { flex: 1; }
}

/* Croix d'abandon du formulaire de reservation (24.09.2026) */
#ec_panel_resa { position: relative; }
.ec-rs-close {
  position: absolute; top: 8px; right: 10px; z-index: 5;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  border: 1px solid #e2e8f0; background: #fff; color: #64748b;
  font-size: 1.1rem; line-height: 1; display: grid; place-items: center;
}
.ec-rs-close:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
/* Numero de course cliquable -> ouvre l'annulation */
.ec-course-id {
  font-size: .76rem; font-weight: 600; color: #64748b; cursor: pointer;
  padding: 2px 7px; border-radius: 6px; background: #f1f5f9;
  border: 1px solid #e2e8f0; margin-left: 6px; white-space: nowrap;
}
.ec-course-id:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }

/* Numero grise sur les courses annulees (lisible, non cliquable) */
.ec-course-id.is-mute {
  cursor: default; background: #f8fafc; color: #94a3b8; border-color: #e2e8f0;
}
.ec-course-id.is-mute:hover {
  background: #f8fafc; color: #94a3b8; border-color: #e2e8f0;
}
/* Purge d'une ligne de test : volontairement discret, ce n'est pas un geste courant */
.ec-act-purge {
  border-color: #fca5a5 !important; color: #b91c1c !important; background: #fff !important;
}
.ec-act-purge:hover { background: #fee2e2 !important; }

/* ==========================================================
   TAF - Historique client : 3 cartes par ligne
   Correctif limite a la fenetre de detail client
   ========================================================== */

.ec-overlay.ec-cl-detail > .ec-modal {
  width: min(1180px, calc(100vw - 32px)) !important;
  max-width: 1180px !important;
  box-sizing: border-box;
  min-width: 0;
}

.ec-cl-detail .ec-cl-hist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  max-height: 55vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.ec-cl-detail .ec-cl-hist > .ec-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  overflow-wrap: anywhere;
}

.ec-cl-detail .ec-cl-hist .ec-card-top {
  min-width: 0;
  flex-wrap: wrap;
}

.ec-cl-detail .ec-cl-hist .ec-card-top > * {
  min-width: 0;
}

.ec-cl-detail .ec-cl-hist .ec-route,
.ec-cl-detail .ec-cl-hist .ec-meta {
  overflow-wrap: anywhere;
}

@media (max-width: 950px) {
  .ec-cl-detail .ec-cl-hist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .ec-cl-detail .ec-cl-hist {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* TAF - Correction des grilles imbriquees dans l'historique client */

.ec-cl-detail .ec-cl-hist {
  display: block;
}

.ec-cl-detail .ec-cl-hist > .taf-row {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  box-sizing: border-box;
}

.ec-cl-detail .ec-cl-hist > .taf-row > .ec-card {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
}

@media (max-width: 950px) {
  .ec-cl-detail .ec-cl-hist > .taf-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .ec-cl-detail .ec-cl-hist > .taf-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

