/* RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #1f2937, #020617);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  color: #e5e7eb;
}

/* DASHBOARD */
.dashboard {
  width: 100%;
  max-width: 1000px;
  background: #0f172a;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}

/* TITLE */
h1 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 32px;
  font-weight: 700;
  color: #f9fafb;
}

/* CARDS */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-bottom: 40px;
}

.card {
  background: linear-gradient(145deg, #020617, #020617);
  border: 1px solid #1e293b;
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.card h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #94a3b8;
  margin-bottom: 16px;
}

.card p {
  font-size: 34px;
  font-weight: 700;
  color: #f1f5f9;
}

/* ACTIONS */
.actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
}

/* BUTTONS */
button,
input {
  padding: 14px 30px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #020617;
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.45);
  transition: all 0.25s ease;
}

button:hover,
input:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.6);
}

button:active,
input:active {
  transform: translateY(0);
}

/* DANGER BUTTON */
button.danger {
  background: linear-gradient(135deg, #fb7185, #e11d48);
  color: #020617;
  box-shadow: 0 10px 30px rgba(225, 29, 72, 0.45);
}

button.danger:hover {
  box-shadow: 0 18px 40px rgba(225, 29, 72, 0.6);
}

/* INPUT DE MONTANT */
input[type="number"] {
  padding: 14px 30px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: #000;
  background-color: #fff;
  border: 2px solid transparent;
  border-radius: 20px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

/* PLACEHOLDER */
input[type="number"]::placeholder {
  color: black;
  text-align: center;
}

/* PLACEHOLDER DISPARAÎT AU FOCUS */
input[type="number"]:focus::placeholder {
  color: transparent;
}

/* FOCUS VISUEL */
input[type="number"]:focus {
  border-color: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* SUPPRESSION DES FLÈCHES (Chrome, Edge, Safari) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* SUPPRESSION DES FLÈCHES (Firefox) */
input[type="number"] {
  -moz-appearance: textfield;
}

/* MODAL BACKGROUND */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* MODAL CONTENT */
.modal-content {
  background: #0f172a;
  padding: 24px;
  border-radius: 12px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #f1f5f9;
}

/* LABELS DANS MODAL */
.modal-content label {
  display: flex;
  flex-direction: column;
  gap: 6px; /* espace entre le texte du label et l'input */
  font-weight: 500;
  color: #f3efef; /* couleur du label */
}

/* INPUTS DANS MODAL */
.modal-content input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
  color: #000; /* texte noir */
  text-align: center; /* texte centré */
}

/* PLACEHOLDER NOIR ET CENTRÉ - compatibles tous navigateurs */
.modal-content input::placeholder {
  color: #000;
  text-align: center;
  opacity: 1; /* important pour Chrome/Firefox */
}

.modal-content input::-webkit-input-placeholder {
  /* Chrome/Edge/Safari */
  color: #000;
  text-align: center;
  opacity: 1;
}

.modal-content input::-moz-placeholder {
  /* Firefox 19+ */
  color: #000;
  text-align: center;
  opacity: 1;
}

.modal-content input:-ms-input-placeholder {
  /* IE 10+ */
  color: #000;
  text-align: center;
  opacity: 1;
}

.modal-content input:-moz-placeholder {
  /* Firefox 18- */
  color: #000;
  text-align: center;
  opacity: 1;
}

/* BOUTONS DANS MODAL */
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

/* BOUTON ANNULER */
#cancelBtn {
  background: #e5e7eb;
}

/* BOUTON VALIDER */
#submitBtn {
  background: #3b82f6;
  color: #fff;
}

/* CACHÉ */
.hidden {
  display: none;
}

/* ANIMATION CARDS */
@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

.animate {
  animation: pop 0.3s ease;
}

/* ORDERS TABLE */
.orders-section {
  margin-top: 32px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
}

.orders-table th,
.orders-table td {
  padding: 12px 16px;
  text-align: left;
  color: #f1f5f9;
}

.orders-table thead {
  background: #1e293b;
}

.orders-table tbody tr {
  border-bottom: 1px solid #1e293b;
}

.orders-table tbody tr:last-child {
  border-bottom: none;
}

.orders-table tbody tr:hover {
  background: #1e293b;
}

/* RESPONSIVE TABLEAU */
@media (max-width: 768px) {
  .orders-table {
    display: block;
    overflow-x: auto;
    width: 100%;
  }

  .orders-table thead,
  .orders-table tbody,
  .orders-table th,
  .orders-table td,
  .orders-table tr {
    display: block;
  }

  .orders-table thead tr {
    display: none;
  }

  .orders-table tbody tr {
    margin-bottom: 16px;
    border-bottom: 2px solid #94a3b8;
    padding: 12px;
    background: #0f172a;
    border-radius: 12px;
  }

  /* ✅ Correction alignement Actions */
  .orders-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center; /* aligne verticalement toutes les cellules */
    padding: 8px 0;
  }

  .orders-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #94a3b8;
    width: 120px; /* même largeur pour tous les labels */
    flex-shrink: 0;
  }

  .orders-table tbody td:last-child {
    justify-content: flex-end; /* poubelle à droite */
  }
}

/* Dernier td (Actions) n'a pas de label sur mobile */
.orders-table tbody td:last-child::before {
  content: ""; /* supprime le label "Actions" */
  width: 0; /* aucune largeur réservée */
}

/* RESPONSIVE MODAL */
@media (max-width: 480px) {
  .modal-content {
    width: 90%;
    padding: 16px;
  }

  .modal-content h2 {
    font-size: 18px;
  }

  .modal-actions {
    flex-direction: column;
    gap: 10px;
  }

  .modal-actions button {
    width: 100%;
  }

  .modal-content input {
    font-size: 14px;
    padding: 10px;
  }
}

/* RESPONSIVE CARDS ET ACTIONS */
@media (max-width: 768px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column;
    gap: 15px;
  }
}
