/* doc-project | pointages/css/style.css | Définit les styles visuels globaux et les modales pour l’index, le pointage, la connexion et les livreurs. | Expose: aucun | Dépend de: index.php, pointage.php, connexion.php | Impacte: UI | Tables: aucune */
/* styles css ici thème sombre */

/* ---- index.php : remonter la zone titre + réduire l'espace sous le titre ---- */
body.page-index .section-heading {
  padding-top: 10px;
  padding-bottom: 10px;
}

body.page-index .section-heading h1 {
  margin: 0 0 8px 0;
}

body.page-index .section-heading .line-dec {
  margin: 6px auto 10px auto;
}

/* ---- Thème sombre global (utilisé via class="theme-dark") ---- */
body.theme-dark {
  background-color: #000000;
}

/* ---- Page connexion.php (accès refusé) ---- */
body.page-connexion {
  background-color: #000;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  font-family: Arial, sans-serif;
}

body.page-connexion button {
  background-color: #00008B; /* Bleu foncé */
  color: #fff; /* Texte blanc */
  border: none;
  padding: 20px 40px; /* Plus gros boutons */
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 2em; /* Taille de texte plus grande */
  margin: 20px;
  border-radius: 25px; /* Bords arrondis */
  cursor: pointer;
  transition: background-color 0.3s;
}

body.page-connexion button:hover {
  background-color: #0000CD; /* Bleu un peu plus clair au survol */
}

.is-hidden {
  display: none !important;
}

/* ---- Styles partagés index.php / pointage.php (boutons + tableaux + modale PIN) ---- */
body.page-pointage button:not(.pin-modal-btn) {
  display: inline-block;
  background-color: #99cc00;
  border-radius: 30px;
  border: 4px double #cccccc;
  color: #eeeeee;
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  padding: 15px;
  width: 90%;
  transition: all 0.5s;
  cursor: pointer;
  margin: 15px;
}

/* Effet ">>" uniquement sur les boutons génériques, pas sur les boutons employés */
body.page-index button:not(.employee-modal-btn):not(.employee-btn) span,
body.page-pointage button span {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: 0.5s;
}

body.page-index button:not(.employee-modal-btn):not(.employee-btn) span:after,
body.page-pointage button span:after {
  content: "\00bb";
  position: absolute;
  opacity: 0;
  top: 0;
  right: -20px;
  transition: 0.5s;
}

body.page-pointage button:not(.pin-modal-btn):hover {
  background-color: #f7c2f9;
}

body.page-index button:not(.employee-modal-btn):not(.employee-btn):hover span,
body.page-pointage button:hover span {
  padding-right: 25px;
}

body.page-index button:not(.employee-modal-btn):not(.employee-btn):hover span:after,
body.page-pointage button:hover span:after {
  opacity: 1;
  right: 0;
}

body.page-index table,
body.page-index th,
body.page-index td,
body.page-pointage table,
body.page-pointage th,
body.page-pointage td {
  padding: 10px;
  border: 1px solid black;
  border-collapse: collapse;
}

body.page-index #pinModal,
body.page-pointage #pinModal {
  display: none; /* Caché par défaut */
  position: fixed; /* Reste en place lors du défilement */
  left: 50%;
  /*
    Mobile-only: on remonte la modale PIN pour que le clavier numérique
    ne couvre pas les boutons "Annuler / Valider".
  */
  top: max(12vh, calc(env(safe-area-inset-top) + 16px));
  transform: translateX(-50%); /* Centrage horizontal uniquement */
  width: 92%;
  max-width: 440px;
  /*
    En cas d'écran très bas (clavier ouvert), on garde la modale utilisable :
    elle peut scroller si nécessaire plutôt que d'avoir les actions coupées.
  */
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background-color: #141414; /* fond sombre */
  color: #ffffff; /* écriture claire */
  padding: 22px 18px;
  z-index: 1000; /* Au-dessus des autres éléments */
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65);
  text-align: center;
}



body.page-index #modalBackground,
body.page-pointage #modalBackground {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.78); /* fond sombre */
  z-index: 999; /* Juste derrière la modale */
}

/* ---- Modale PIN (nouveau design) ---- */
body.page-index #pinModal .pin-modal-title,
body.page-pointage #pinModal .pin-modal-title {
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
}

body.page-index #pinModal .pin-modal-subtitle,
body.page-pointage #pinModal .pin-modal-subtitle {
  margin: 0 0 14px 0;
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
}

body.page-index #pinModal .pin-input-wrapper,
body.page-pointage #pinModal .pin-input-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 14px auto;
  cursor: text;
}

body.page-index #pinModal .pin-boxes,
body.page-pointage #pinModal .pin-boxes {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

body.page-index #pinModal .pin-box,
body.page-pointage #pinModal .pin-box {
  width: 58px;
  height: 58px;
  background-color: #f2f2f2; /* gris très clair */
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  font-weight: 900;
  color: #111111;
  user-select: none;
}

body.page-index #pinModal .pin-hidden-input,
body.page-pointage #pinModal .pin-hidden-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px; /* évite le zoom iOS */
}

body.page-index #pinModal .pin-modal-actions,
body.page-pointage #pinModal .pin-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
}

body.page-index #pinModal .pin-modal-btn,
body.page-pointage #pinModal .pin-modal-btn {
  flex: 1;
  width: auto;
  margin: 0;
  border: none;
  border-radius: 12px;
  padding: 14px 10px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

body.page-index #pinModal .pin-modal-btn.confirm,
body.page-pointage #pinModal .pin-modal-btn.confirm {
  background-color: #007BFF;
  color: #ffffff;
}
body.page-index #pinModal .pin-modal-btn.confirm:hover,
body.page-pointage #pinModal .pin-modal-btn.confirm:hover {
  background-color: #0069d9;
}

body.page-index #pinModal .pin-modal-btn.cancel,
body.page-pointage #pinModal .pin-modal-btn.cancel {
  background-color: #555555;
  color: #ffffff;
}
body.page-index #pinModal .pin-modal-btn.cancel:hover,
body.page-pointage #pinModal .pin-modal-btn.cancel:hover {
  background-color: #242424;
}

body.page-index .device-pos-reset {
  display: block;
  width: 92%;
  max-width: 520px;
  margin: 0 auto 14px auto;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background-color: #3a1010;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

body.page-index .device-pos-reset:hover {
  background-color: #521717;
}

body.page-index .device-pos-reset.is-disabled,
body.page-index .device-pos-reset.is-disabled:hover,
body.page-index .device-pos-reset[aria-disabled="true"],
body.page-index .device-pos-reset[aria-disabled="true"]:hover {
  background-color: #2b2b2b;
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.62);
  cursor: not-allowed;
  opacity: 0.72;
}

body.page-index .device-pos-reset.is-disabled span,
body.page-index .device-pos-reset[aria-disabled="true"] span {
  pointer-events: none;
}


/* ---- index.php : grille employés (anciennement inline styles) ---- */
body.page-index table.employee-grid {
  width: 92%;
  table-layout: fixed;
  border-collapse: separate; /* évite les traits de "tableau" */
  border-spacing: 18px 18px; /* espace entre les boutons */
}

body.page-index table.employee-grid td.employee-grid-cell {
  width: 50%;
  padding: 0;
  border: none;
  vertical-align: top;
}

/* Supprime bordures/padding hérités du style général des tableaux (traits noirs visibles) */
body.page-index table.employee-grid,
body.page-index table.employee-grid th,
body.page-index table.employee-grid td {
  border: none;
  padding: 0;
}

/* ---- index.php : Modal actions employé ---- */
body.page-index #employeeModalBackground {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1099;
}

body.page-index #employeeActionModal {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #888;
  background-color: #1b1b1b; /* fond gris très foncé */
  color: #ffffff; /* texte par défaut en blanc (ex: "Actions") */
  padding: 22px 20px;
  z-index: 1100;
  width: 92%;
  max-width: 520px;
  border-radius: 12px;
  text-align: center;
}

body.page-index #employeeActionModal h2 {
  margin: 0 0 14px 0;
  font-size: 22px;
  font-weight: 800;
  color: #ffffff; /* "Actions" en blanc */
}

body.page-index .employee-modal-btn {
  width: 100%;
  margin: 10px 0;
  padding: 16px;
  border-radius: 14px;
  border: none;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

body.page-index .employee-modal-btn.punch {
  background-color: #007BFF;
  color: #ffffff;
}
body.page-index .employee-modal-btn.punch:hover {
  background-color: #0069d9;
}

/* ---- index.php : Bouton Départ en rouge (dans la modale actions employé) ---- */
body.page-index .employee-modal-btn.punch.is-depart {
  background-color: #dc3545; /* Rouge (départ) */
  color: #ffffff;
}
body.page-index .employee-modal-btn.punch.is-depart:hover {
  background-color: #c82333; /* Rouge plus foncé au survol */
}

body.page-index .employee-modal-btn.details {
  background-color: #99cc00;
  color: #000000;
}
body.page-index .employee-modal-btn.details:hover {
  background-color: #8fbf00;
}

/* -------------------------------------------------------------------------- */
/* Toasts (remplacement des alert)                                            */
/* -------------------------------------------------------------------------- */
.app-toast-container {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: 92%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000;
  pointer-events: none; /* permet de cliquer "à travers" sauf sur le toast */
}

.app-toast {
  pointer-events: auto;
  position: relative;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  background-color: #1b1b1b;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-toast.success {
  background-color: #0a7a2f;
}
.app-toast.error {
  background-color: #9b1c1c;
}
.app-toast.info {
  background-color: #1f3a66;
}

.app-toast.app-toast-centered-message .app-toast-message {
  text-align: center;
}

.app-toast .app-toast-close {
  position: absolute;
  right: 10px;
  top: 6px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  opacity: 0.9;
}
.app-toast .app-toast-close:hover {
  opacity: 1;
}

/* -------------------------------------------------------------------------- */
/* Modale générique de confirmation (remplacement des confirm)                */
/* -------------------------------------------------------------------------- */
.app-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 2200;
}

.app-modal {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 520px;
  background-color: #1b1b1b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 18px 16px;
  z-index: 2201;
  text-align: center;
}

.app-modal h3 {
  margin: 0 0 10px 0;
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
}

.app-modal p {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 700;
}

.app-modal .app-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.app-modal .app-modal-btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 14px 10px;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.app-modal .app-modal-btn.confirm {
  background-color: #007BFF;
  color: #ffffff;
}
.app-modal .app-modal-btn.confirm:hover {
  background-color: #0069d9;
}

.app-modal .app-modal-btn.cancel {
  background-color: #555555;
  color: #ffffff;
}
.app-modal .app-modal-btn.cancel:hover {
  background-color: #444444;
}

/* -------------------------------------------------------------------------- */
/* Modale PDV par défaut appareil                                             */
/* -------------------------------------------------------------------------- */
body.device-pos-modal-open {
  overflow: hidden;
}

.device-pos-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.78);
  z-index: 2400;
}

.device-pos-modal {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 520px;
  background-color: #141414;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65);
  padding: 22px 18px;
  z-index: 2401;
  text-align: center;
}

.device-pos-modal h3 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
}

.device-pos-modal p {
  margin: 0 0 16px 0;
  font-size: 17px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
}

.device-pos-label {
  display: block;
  margin: 0 0 8px 0;
  text-align: left;
  font-size: 16px;
  font-weight: 800;
}

.device-pos-select {
  width: 100%;
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: #f2f2f2;
  color: #111111;
  font-size: 18px;
  font-weight: 800;
  padding: 12px 14px;
  box-sizing: border-box;
}

.device-pos-actions {
  margin-top: 16px;
}

.device-pos-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 10px;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
}

.device-pos-btn.confirm {
  background-color: #007BFF;
  color: #ffffff;
}

.device-pos-btn.confirm:hover {
  background-color: #0069d9;
}

.device-pos-link {
  margin-top: 12px;
  padding: 0;
  border: none;
  background: transparent;
  color: #9ecbff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

body.page-index .device-pos-quick-change {
  display: block;
  width: 92%;
  max-width: 520px;
  margin: 0 auto 14px auto;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background-color: #1b1b1b;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

body.page-index .device-pos-quick-change:hover {
  background-color: #242424;
}

body.page-index .driver-phone-trigger {
  display: block;
  width: 92%;
  max-width: 520px;
  margin: 0 auto 14px auto;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background-color: #1f3a66;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

body.page-index .driver-phone-trigger:hover {
  background-color: #1f3a66;
  color: #ffffff;
}

/* -------------------------------------------------------------------------- */
/* Modales livreurs : sélection + gestion                                     */
/* -------------------------------------------------------------------------- */
body.modal-open-driver {
  overflow: hidden;
}

body.driver-manage-modal-open {
  overflow: hidden;
}

.driver-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.78);
}

.driver-modal {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 520px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: #141414;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65);
  padding: 22px 18px;
  text-align: center;
}

.driver-manage-modal {
  max-width: 560px;
}

body.page-index #driverManageModalBackground {
  z-index: 2600;
}

body.page-index #driverManageModal {
  z-index: 2601;
}

body.page-index #driverPhoneModal[aria-hidden="false"] {
  z-index: 2501;
}

body.page-index #driverModalBackground[aria-hidden="false"] {
  z-index: 2500;
}

body.page-index #driverManageModal[aria-hidden="false"] {
  z-index: 2601;
}

body.page-index #driverManageModalBackground[aria-hidden="false"] {
  z-index: 2600;
}

.driver-modal-actions-split {
  margin-bottom: 10px;
}

.driver-modal-btn.secondary {
  background-color: #2a2a2a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.driver-modal-btn.secondary:hover {
  background-color: #242424;
}

.driver-modal-btn.danger {
  background-color: #9b1c1c;
  color: #ffffff;
}

.driver-modal-btn.danger:hover {
  background-color: #7e1717;
}