/* =========================================================
   CLIENTS.CSS
   ========================================================= */

:root {
  --orange: #ff7426;
  --orange-light: #fff0e8;
  --dark: #24242a;
  --gray: #85858f;
  --gray-light: #f7f7f9;
  --line: #e7e7ec;

  --green: #2a9860;
  --red: #e65349;
  --purple: #7566c8;
  --yellow: #e99a3c;
}


/* =========================================================
   BASE
   ========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--gray-light);
  color: var(--dark);

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  overflow-x: hidden;
}


/* =========================================================
   APPLICATION
   ========================================================= */

.app {
  width: 100%;
  min-height: 100vh;

  margin: 0;
  padding: 0 0 90px;

  background: white;
}


/* =========================================================
   PAGE CLIENTS
   ========================================================= */

.page {
  width: 100%;
  max-width: 900px;

  margin: 0 auto;

  padding: 28px 20px 30px;
}


/* =========================================================
   TITRE
   ========================================================= */

.page-header {
  width: 100%;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 0;

  color: var(--dark);

  font-size: 32px;
  font-weight: 800;
}

.page-header p {
  margin: 6px 0 0;

  color: var(--gray);

  font-size: 13px;
}


/* =========================================================
   RECHERCHE
   ========================================================= */

.search-section {
  width: 100%;
  margin-bottom: 20px;
}

.search-box {
  display: flex;

  align-items: center;

  width: 100%;
  height: 62px;

  padding: 0 12px;

  border: 1px solid var(--line);
  border-radius: 18px;

  background: white;

  box-shadow:
    0 5px 18px rgba(36, 36, 42, .05);
}

.search-box:focus-within {
  border-color: #ffb78c;

  box-shadow:
    0 6px 22px rgba(255, 116, 38, .10);
}

.search-icon {
  display: flex;

  width: 42px;
  min-width: 42px;

  align-items: center;
  justify-content: center;

  color: var(--gray);

  font-size: 23px;
}

.search-box input {
  width: 100%;
  height: 100%;

  padding: 0;

  border: 0;
  outline: none;

  background: transparent;

  color: var(--dark);

  font-size: 15px;
}

.search-box input::placeholder {
  color: #a2a2aa;
}


/* =========================================================
   LISTE CLIENTS
   ========================================================= */

.clients-list {
  display: flex;

  width: 100%;

  flex-direction: column;

  gap: 10px;
}

.client-card {
  display: flex;

  align-items: center;

  width: 100%;
  min-height: 76px;

  padding: 12px 15px;

  border: 1px solid var(--line);
  border-radius: 17px;

  background: white;

  color: var(--dark);

  text-align: left;

  box-shadow:
    0 3px 12px rgba(36, 36, 42, .025);

  transition:
    .15s ease;
}

.client-card:hover {
  border-color: #ffc4a4;

  box-shadow:
    0 7px 20px rgba(36, 36, 42, .06);
}

.client-card-avatar {
  display: flex;

  width: 48px;
  height: 48px;
  min-width: 48px;

  align-items: center;
  justify-content: center;

  margin-right: 13px;

  border-radius: 50%;

  background: var(--orange-light);

  color: var(--orange);

  font-size: 15px;
  font-weight: 800;
}

.client-card-info {
  min-width: 0;
  flex: 1;
}

.client-card-info h2 {
  margin: 0 0 5px;

  overflow: hidden;

  color: var(--dark);

  font-size: 15px;
  font-weight: 700;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-card-info p {
  margin: 0;

  overflow: hidden;

  color: var(--gray);

  font-size: 12px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-card-arrow {
  margin-left: 10px;

  color: #aaaab3;

  font-size: 26px;
}


/* =========================================================
   ÉTAT VIDE
   ========================================================= */

.empty-state {
  width: 100%;

  padding: 45px 20px;

  border: 1px dashed #d9d9df;
  border-radius: 18px;

  background: #fafafd;

  text-align: center;
}

.empty-icon {
  display: flex;

  width: 52px;
  height: 52px;

  align-items: center;
  justify-content: center;

  margin: 0 auto 14px;

  border-radius: 15px;

  background: var(--orange-light);

  color: var(--orange);

  font-size: 24px;
}

.empty-state h2 {
  margin: 0 0 7px;

  font-size: 18px;
}

.empty-state p {
  max-width: 340px;

  margin: 0 auto;

  color: var(--gray);

  font-size: 13px;

  line-height: 1.5;
}


/* =========================================================
   MODALE CLIENT
   ========================================================= */

.client-modal {
  width: min(94vw, 680px);
  max-width: 680px;
  max-height: 90vh;

  padding: 0;

  overflow: hidden;

  border: 0;
  border-radius: 24px;

  background: white;

  box-shadow:
    0 25px 80px rgba(0, 0, 0, .25);
}

.client-modal::backdrop {
  background: rgba(0, 0, 0, .55);
}

.client-modal-content {
  width: 100%;
  max-height: 90vh;

  overflow-y: auto;

  padding: 25px 21px 30px;
}


/* =========================================================
   CLIENT
   ========================================================= */

.client-detail-header {
  display: flex;

  align-items: center;

  width: 100%;

  padding-right: 35px;
}

.client-avatar {
  display: flex;

  width: 60px;
  height: 60px;
  min-width: 60px;

  align-items: center;
  justify-content: center;

  margin-right: 14px;

  border-radius: 50%;

  background: var(--orange-light);

  color: var(--orange);

  font-size: 20px;
  font-weight: 800;
}

.client-title {
  min-width: 0;
}

.client-title h2 {
  margin: 0 0 5px;

  overflow: hidden;

  color: var(--dark);

  font-size: 26px;
  font-weight: 800;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-link {
  color: var(--gray);

  font-size: 13px;

  text-decoration: none;
}


/* =========================================================
   CLIENT DEPUIS
   ========================================================= */

.since-card {
  display: flex;

  align-items: center;

  width: 100%;

  margin-top: 20px;

  padding: 14px;

  border: 1px solid var(--line);
  border-radius: 16px;

  background: #fafafd;
}

.since-icon {
  display: flex;

  width: 43px;
  height: 43px;
  min-width: 43px;

  align-items: center;
  justify-content: center;

  margin-right: 12px;

  border-radius: 12px;

  background: var(--orange-light);

  color: var(--orange);

  font-size: 20px;
}

.since-copy {
  display: flex;

  flex: 1;

  flex-direction: column;

  gap: 3px;
}

.since-copy small {
  color: var(--gray);

  font-size: 11px;
}

.since-copy strong {
  font-size: 14px;
}


/* =========================================================
   STATISTIQUES
   ========================================================= */

.stats-grid {
  display: grid;

  grid-template-columns: repeat(4, 1fr);

  gap: 8px;

  width: 100%;

  margin-top: 13px;
}

.stat-card {
  min-width: 0;

  padding: 14px 5px;

  border-radius: 15px;

  color: white;

  text-align: center;
}

.stat-card strong {
  display: block;

  margin-bottom: 5px;

  font-size: 25px;
  font-weight: 800;
}

.stat-card span {
  display: block;

  overflow: hidden;

  font-size: 10px;
  font-weight: 700;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card.postponed {
  background: var(--yellow);
}

.stat-card.cancelled {
  background: var(--red);
}

.stat-card.late {
  background: var(--purple);
}

.stat-card.visited {
  background: var(--green);
}


/* =========================================================
   HISTORIQUE
   ========================================================= */

.history-section {
  width: 100%;
  margin-top: 28px;
}

.section-heading {
  display: flex;

  align-items: center;
  justify-content: space-between;

  margin-bottom: 12px;
}

.section-heading h3 {
  margin: 0;

  font-size: 19px;
}

.history-count {
  display: flex;

  width: 29px;
  height: 29px;

  align-items: center;
  justify-content: center;

  border-radius: 10px;

  background: #f1f1f4;

  color: var(--gray);

  font-size: 12px;
  font-weight: 700;
}

.history-list {
  display: flex;

  width: 100%;

  flex-direction: column;

  gap: 8px;
}

.history-item {
  display: grid;

  grid-template-columns: 90px minmax(0, 1fr) auto;

  align-items: center;

  gap: 10px;

  width: 100%;

  padding: 12px;

  border: 1px solid var(--line);
  border-radius: 14px;

  background: white;
}

.history-date strong,
.history-service strong {
  font-size: 12px;
}

.history-date span,
.history-service span {
  display: block;

  margin-top: 3px;

  color: var(--gray);

  font-size: 11px;
}

.history-service {
  min-width: 0;
}

.history-service strong {
  display: block;

  overflow: hidden;

  text-overflow: ellipsis;
  white-space: nowrap;
}


/* =========================================================
   BADGES
   ========================================================= */

.status-badge {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  min-height: 27px;

  padding: 6px 8px;

  border-radius: 9px;

  font-size: 10px;
  font-weight: 800;

  white-space: nowrap;
}

.status-badge.visited {
  background: #def6e8;
  color: #19784b;
}

.status-badge.cancelled {
  background: #ffe7e4;
  color: #c44037;
}

.status-badge.postponed {
  background: #fff0dc;
  color: #a55a14;
}

.status-badge.late {
  background: #eeeaff;
  color: #6250a8;
}

.status-badge.waiting {
  background: #f0f0f3;
  color: #6f6f79;
}


/* =========================================================
   =========================================================
   BARRE DE TÂCHE
   =========================================================
   ========================================================= */

/*
   Elle est volontairement indépendante de .app et .page.
   Elle prend toute la largeur de la fenêtre.
*/

.bottom-nav {
  position: fixed !important;

  z-index: 999999 !important;

  bottom: 0 !important;
  left: 0 !important;

  right: 0 !important;

  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  height: 72px;

  margin: 0 !important;

  padding: 7px 0 8px;

  display: flex !important;

  flex-direction: row !important;

  align-items: stretch !important;
  justify-content: space-around !important;

  border-top: 1px solid var(--line);

  background: rgba(255, 255, 255, .98);

  box-shadow:
    0 -4px 18px rgba(0, 0, 0, .07);

  backdrop-filter: blur(12px);

  transform: none !important;
}


/*
   Chaque bouton prend la même largeur.
*/

.bottom-nav .nav-link {
  position: relative;

  display: flex !important;

  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;

  height: 100%;

  flex: 1 1 0 !important;

  align-items: center;
  justify-content: center;

  flex-direction: column;

  gap: 3px;

  margin: 0 !important;
  padding: 3px 2px;

  border: 0;

  background: transparent;

  color: #92929c;

  text-decoration: none;

  text-align: center;

  font-size: 20px;
}


/*
   Texte des boutons
*/

.bottom-nav .nav-link span {
  display: block;

  width: 100%;

  overflow: hidden;

  font-size: 10px;
  font-weight: 600;

  line-height: 1.2;

  text-overflow: ellipsis;
  white-space: nowrap;
}


/*
   Onglet actif
*/

.bottom-nav .nav-link.active {
  color: var(--orange);
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

  .page {
    padding: 23px 14px 95px;
  }

  .page-header h1 {
    font-size: 29px;
  }

  .search-box {
    height: 58px;
  }

  .client-modal {
    width: 96vw;
    border-radius: 21px;
  }

  .client-modal-content {
    padding: 22px 15px 25px;
  }

  .client-title h2 {
    font-size: 21px;
  }

  .stats-grid {
    gap: 5px;
  }

  .stat-card {
    padding: 12px 3px;
  }

  .stat-card strong {
    font-size: 21px;
  }

  .stat-card span {
    font-size: 9px;
  }

  .history-item {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 8px;
  }

  .status-badge {
    grid-column: 2;
    justify-self: start;
  }


  /* BARRE MOBILE */

  .bottom-nav {
    width: 100vw !important;

    height: 70px;

    padding-left: 0;
    padding-right: 0;

    padding-bottom:
      calc(7px + env(safe-area-inset-bottom));
  }

  .bottom-nav .nav-link {
    flex: 1 1 0 !important;

    padding-left: 0;
    padding-right: 0;

    font-size: 18px;
  }

  .bottom-nav .nav-link span {
    font-size: 9px;
  }
}


/* =========================================================
   PETITS TÉLÉPHONES
   ========================================================= */

@media (max-width: 360px) {

  .page {
    padding-right: 11px;
    padding-left: 11px;
  }

  .bottom-nav .nav-link {
    font-size: 17px;
  }

  .bottom-nav .nav-link span {
    font-size: 8px;
  }
}