/* 🌈 RCgestion POS 2025 - Style global */
body {
  font-family: 'Cairo', sans-serif;
  margin: 0;
  background: linear-gradient(135deg, #f3f4f6, #e0e7ff);
  color: #1e293b;
}

/* 🔹 Header moderne */
.pos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  color: white;
  padding: 10px 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.brand h2 {
  margin: 0;
  font-weight: 700;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-center input {
  width: 60%;
  min-width: 220px;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-total {
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: 12px;
  backdrop-filter: blur(5px);
  font-size: 0.95rem;
}
.header-total strong {
  color: #fff;
  font-size: 1.1rem;
}

.btn-tickets {
  background: #06b6d4;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: 0.3s;
}
.btn-tickets:hover { background: #0891b2; transform: scale(1.05); }

/* === Mise en page moderne élargie === */
.pos-container {
  display: grid;
  grid-template-columns: 180px 1fr 450px; /* 🧾 zone panier plus large */
  gap: 14px;
  padding: 12px;
  align-items: start;
}


/* 📁 Catégories */
.categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.categories button {
  background: #e2e8f0;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}
.categories button:hover { background: #cbd5e1; }
.categories button.active {
  background: #2563eb;
  color: white;
}

/* 🛒 Produits */
.produits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  padding: 10px;
}
.produit {
  background: white;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  text-align: center;
  cursor: pointer;
  padding: 12px;
  transition: all 0.3s ease;
}
.produit:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.produit img {
  width: 100%;
  height: 100px;
  object-fit: contain;
}
.produit h4 {
  margin: 6px 0;
  color: #1e3a8a;
}
.produit .info {
  font-size: 0.85rem;
  color: #475569;
}

/* 🧾 Panier */
.panier {
  background: white;
  border-radius: 14px;
  padding: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}
.panier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panier-header button {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}
.panier-header button:hover { background: #dc2626; }

/* Table panier */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 10px;
}
th, td {
  border-bottom: 1px solid #e5e7eb;
  padding: 6px;
  text-align: center;
}

/* 🧮 Calculatrice */
.calc {
  margin-top: 10px;
}
.calc input {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-bottom: 5px;
}
.calc-keys {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.calc-keys button {
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #e2e8f0;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}
.calc-keys button:hover { background: #93c5fd; }

/* 💰 Total global */
.total-section {
  text-align: center;
  margin-top: 1px;
}

/* 🎟 Popup Tickets */
.popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  justify-content: center;
  align-items: center;
  z-index: 5000;
}
.popup.active { display: flex; }

.popup-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 25px;
  width: 95%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  color: #1e293b;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  animation: fadeIn 0.25s ease;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.btn-x {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #374151;
  cursor: pointer;
}
.btn-x:hover { color: #dc2626; }

.popup-search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-bottom: 10px;
}

.popup-summary {
  font-weight: 600;
  background: #f1f5f9;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.tickets-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.ticket-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-size: 0.9rem;
  transition: 0.2s;
}
.ticket-card:hover { transform: translateY(-4px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.ticket-card h4 { margin: 5px 0; color: #1e3a8a; }

.popup-footer {
  text-align: center;
  margin-top: 12px;
}

.btn-close {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
}
.btn-close:hover { background: #1e40af; }
/* === Barre verticale d'actions modernes === */
/* === Grille d'actions uniformes === */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.actions-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border: none;
  color: #fff;
  border-radius: 12px;
  padding: 12px 0;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.85rem;
  min-height: 80px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.actions-grid button i {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

/* 🎨 Couleurs distinctes */
#btnPrint { background: linear-gradient(135deg, #3b82f6, #2563eb); }
#btnRapport { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
#btnReprendre { background: linear-gradient(135deg, #f59e0b, #d97706); }
#btnCredit { background: linear-gradient(135deg, #22c55e, #15803d); }
#btnValider { background: linear-gradient(135deg, #22c55e, #15803d); }
#btnVersement { background: linear-gradient(135deg, #ec4899, #db2777); }

.actions-grid button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* 🧠 Responsive */
@media (max-width: 1000px) {
  .actions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .actions-grid button {
    font-size: 0.8rem;
    min-height: 70px;
  }
  .actions-grid button i {
    font-size: 1.2rem;
  }
}

@keyframes fadeIn {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 📱 Responsive */
@media (max-width: 900px) {
  .pos-container {
    grid-template-columns: 1fr;
  }
  .header-center input {
    width: 100%;
  }
  .header-right {
    flex-direction: column;
    gap: 5px;
  }
}
