/* SUPPORT — Mon Invoice (support.js) */

.sup-fond {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .5);
}

.sup-fond[hidden] { display: none; }

.sup-fenetre {
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .3);
  color: #1f2937;
  font-size: 14px;
}

.sup-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #1f3a68;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.sup-x {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.sup-onglets {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.sup-onglets button,
.sup-filtres button {
  padding: 10px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: #4b5563;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.sup-onglets button.actif {
  border-bottom-color: #1f3a68;
  color: #1f3a68;
}

.sup-corps {
  flex: 1;
  padding: 16px 18px 20px;
  overflow-y: auto;
}

.sup-intro { margin: 0 0 12px; color: #374151; }

.sup-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.sup-contact {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 16px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.sup-contact:hover { border-color: #1f3a68; background: #f5f8ff; }
.sup-contact span { font-size: 26px; }
.sup-contact small { color: #6b7280; font-size: 12px; word-break: break-all; }
.sup-contact.sup-wa { border-color: #25d366; background: #ecfdf3; }
.sup-contact.sup-wa:hover { background: #dcfce7; }

.sup-horaires { margin: 14px 0 0; color: #4b5563; font-size: 13px; }

.sup-form { display: grid; gap: 10px; }

.sup-form label {
  display: grid;
  gap: 4px;
  color: #374151;
  font-size: 12.5px;
  font-weight: 600;
}

.sup-form input,
.sup-form select,
.sup-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  box-sizing: border-box;
}

.sup-form textarea { resize: vertical; }

.sup-ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sup-ligne select { width: auto; }

.sup-bouton {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.sup-bouton.sup-principal { border-color: #1f3a68; background: #1f3a68; color: #fff; }
.sup-bouton:disabled { opacity: .6; cursor: wait; }

.sup-aide { margin: 0; color: #6b7280; font-size: 12.5px; }

.sup-lien {
  padding: 0;
  border: 0;
  background: none;
  color: #2563eb;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.sup-message { margin: 0 0 10px; color: #15803d; font-size: 13.5px; font-weight: 600; }
.sup-message:empty { display: none; }
.sup-message.sup-ko { color: #b42318; }

.sup-vide { margin: 10px 0; color: #6b7280; }

.sup-filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.sup-filtres button {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 99px;
}

.sup-filtres button.actif { border-color: #1f3a68; background: #1f3a68; color: #fff; }

.sup-ticket {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sup-ticket:hover { border-color: #1f3a68; }
.sup-ticket.sup-non-lu { border-left: 4px solid #dc2626; background: #fffafa; }
.sup-ticket small { display: block; margin-top: 3px; color: #6b7280; font-size: 12px; }
.sup-ticket .sup-apercu { color: #4b5563; }

.sup-statut {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.sup-statut.sup-nouveau { background: #e0f2fe; color: #075985; }
.sup-statut.sup-en-cours { background: #fef3c7; color: #92400e; }
.sup-statut.sup-resolu { background: #dcfce7; color: #166534; }

.sup-retour {
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: #2563eb;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.sup-detail-entete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sup-detail-entete h3 { margin: 0; font-size: 16px; }
.sup-detail-entete small { color: #6b7280; font-size: 12px; }

.sup-fil {
  display: grid;
  gap: 8px;
  max-height: 46vh;
  margin-bottom: 12px;
  padding: 10px;
  overflow-y: auto;
  border-radius: 10px;
  background: #f3f4f6;
}

.sup-bulle {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.sup-bulle.sup-support { justify-self: start; background: #e9eef8; }
.sup-bulle.sup-client { justify-self: end; background: #dcfce7; }
.sup-bulle small { color: #6b7280; font-size: 11.5px; }
.sup-bulle p { margin: 4px 0 0; white-space: normal; word-wrap: break-word; }
.sup-bulle img { display: block; max-width: 220px; max-height: 160px; margin-top: 6px; border-radius: 8px; }

.sup-faq {
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.sup-faq summary { font-weight: 700; cursor: pointer; }
.sup-faq p { margin: 8px 0 0; color: #374151; line-height: 1.5; }

/* Pastille rouge dans le menu */
#open-support .sup-pastille {
  display: inline-block;
  min-width: 18px;
  margin-left: 8px;
  padding: 0 5px;
  border-radius: 99px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

#open-support .sup-pastille[hidden] { display: none; }

@media (max-width: 600px) {
  .sup-fond { padding: 0; }
  .sup-fenetre { max-height: 100vh; height: 100%; border-radius: 0; }
  .sup-corps { padding: 14px 12px; }
  .sup-bulle { max-width: 95%; }
}

/* Alerte « nouvelle connexion » (réglages administrateur) */
.sup-securite { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e5e7eb; }
.sup-securite h3 { margin: 0; color: #193b7a; font-size: 16px; }
.sup-etapes { margin: 0; padding-left: 20px; color: #374151; font-size: 13.5px; line-height: 1.55; }
.sup-etapes a { color: #2563eb; }
