/* ==========================================================================
   CAISSE POS MODULAIRE — STYLES "PAR PIÈCE & PAR PISTE" (DARK & LIGHT THEME)
   Fichier : caisse/caisse.css
   ========================================================================== */

/* --- 1. COLONNE 1 : ONGLETS FILE DU JOUR (PISTES / BAR EN ATTENTE / IMPAYÉS) --- */
.caisse-file-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: rgba(6, 9, 19, 0.75);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.caisse-file-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 800;
  padding: 7px 6px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.caisse-file-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.caisse-file-tab-btn.active {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.22), rgba(34, 197, 94, 0.12));
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.45);
  box-shadow: 0 2px 8px rgba(74, 222, 128, 0.15);
}

.caisse-file-tab-badge {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 900;
}

.caisse-file-tab-btn.active .caisse-file-tab-badge {
  background: #4ade80;
  color: #052e16;
}

/* Filtres rapides par Piste (P1, P2, P3...) */
.caisse-piste-filter-bar {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.caisse-piste-filter-bar::-webkit-scrollbar {
  display: none;
}

.caisse-piste-pill {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.caisse-piste-pill:hover {
  border-color: #38bdf8;
  color: #fff;
}

.caisse-piste-pill.active {
  background: #38bdf8;
  border-color: #38bdf8;
  color: #020617;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

/* Section Header Piste dans la File */
.caisse-piste-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  margin: 8px 0 4px 0;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.4));
  border-left: 3px solid #38bdf8;
  border-radius: 6px;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 900;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Badge Sortie de Piste / En cours */
.caisse-live-session-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.caisse-live-session-badge.checkout-now {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  border: 1px solid #f59e0b;
  animation: caissePulseAmber 2s infinite;
}

.caisse-live-session-badge.playing-now {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid #38bdf8;
}

@keyframes caissePulseAmber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(245, 158, 11, 0); }
}

/* --- 2. COLONNE 2 : BARRE CIBLE ACTIVE & MULTIPLICATEUR "PAR PIÈCE" --- */
.caisse-target-cockpit-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(7, 13, 25, 0.98));
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.caisse-target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.caisse-target-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  flex: 1;
}

.caisse-target-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.caisse-target-pill:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.caisse-target-pill.active {
  color: #020617;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
  transform: translateY(-1px);
}

/* Multiplicateur de pièces (+1, x2, x3, x4, 1/joueur) */
.caisse-qty-multiplier-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(3, 6, 11, 0.75);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.caisse-qty-pill {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.caisse-qty-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.caisse-qty-pill.active {
  background: #f59e0b;
  color: #020617;
  border-color: #fbbf24;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* --- 3. COLONNE 3 : COCKPIT PANIER "PAR PIÈCE" & PANIERS JOUEURS UNIFIÉS --- */
.caisse-piece-line-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 6px;
  transition: all 0.15s ease;
}

.caisse-piece-line-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.caisse-piece-line-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Stepper [- 1 +] à la pièce */
.caisse-piece-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(3, 6, 11, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  padding: 2px;
  flex-shrink: 0;
}

.caisse-piece-step-btn {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: none;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.caisse-piece-step-btn:hover {
  background: var(--accent-green);
  color: #020617;
}

.caisse-piece-step-btn.minus:hover {
  background: #ef4444;
  color: #fff;
}

.caisse-piece-qty-badge {
  min-width: 24px;
  text-align: center;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 900;
  color: #fbbf24;
  padding: 0 4px;
}

/* Actions d'attribution d'1 pièce vers J1..J6 ou Partage sur-mesure */
.caisse-piece-assign-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding-top: 5px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.caisse-piece-assign-btn {
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 900;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.12s ease;
}

.caisse-piece-assign-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

/* Carte Joueur accordéon dans Colonne 3 */
.caisse-player-cockpit-card {
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 17, 32, 0.9);
  overflow: hidden;
  transition: all 0.18s ease;
}

.caisse-player-cockpit-card.is-active-target {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15), 0 6px 18px rgba(0, 0, 0, 0.45);
}

.caisse-player-cockpit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  cursor: pointer;
  gap: 8px;
  user-select: none;
}

.caisse-player-cockpit-body {
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 6, 11, 0.55);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Boutons d'encaissement express 1-clic par joueur */
.caisse-express-pay-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.caisse-express-pay-btn {
  flex: 1;
  font-family: var(--font-title);
  font-size: 10.5px;
  font-weight: 900;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.caisse-express-pay-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

/* --- 4. MODALE DE PARTAGE SUR-MESURE ("PARTAGER CETTE PIÈCE ENTRE...") --- */
.caisse-custom-split-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(5px);
  z-index: 100050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.caisse-custom-split-modal {
  background: #0f172a;
  border: 2px solid #38bdf8;
  border-radius: 16px;
  width: 100%;
  max-width: 460px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  color: #f8fafc;
}

.caisse-split-player-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.15s ease;
}

.caisse-split-player-check.selected {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
}

/* --- 5. COMPATIBILITÉ THÈME CLAIR (LIGHT THEME OVERRIDES) --- */
html.light-theme .caisse-file-tabs {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

html.light-theme .caisse-file-tab-btn {
  color: #475569 !important;
}

html.light-theme .caisse-file-tab-btn.active {
  background: #ffffff !important;
  color: #0284c7 !important;
  border-color: #0284c7 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15) !important;
}

html.light-theme .caisse-piste-pill {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

html.light-theme .caisse-piste-pill.active {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}

html.light-theme .caisse-target-cockpit-bar {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

html.light-theme .caisse-target-pill {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

html.light-theme .caisse-qty-multiplier-group {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

html.light-theme .caisse-qty-pill {
  color: #334155 !important;
}

html.light-theme .caisse-piece-line-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

html.light-theme .caisse-piece-stepper {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

html.light-theme .caisse-piece-step-btn {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

html.light-theme .caisse-piece-qty-badge {
  color: #0f172a !important;
}

html.light-theme .caisse-player-cockpit-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

html.light-theme .caisse-player-cockpit-body {
  background: #f8fafc !important;
  border-top-color: #e2e8f0 !important;
}

html.light-theme .caisse-custom-split-modal {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #0284c7 !important;
}

html.light-theme .caisse-split-player-check {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html.light-theme .caisse-split-player-check.selected {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
}

/* --- 6. STATUTS CARTES FILE DU JOUR : ROUGE (NON CLÔTURÉ) vs VERT (CLÔTURÉ) --- */
.caisse-card-unclosed-red {
  border-left: 5px solid #ef4444 !important;
  box-shadow: 0 3px 12px rgba(239, 68, 68, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.caisse-card-unclosed-red:hover {
  transform: translateY(-1px);
  border-color: #f87171 !important;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35) !important;
}

.caisse-card-closed-green {
  border-left: 5px solid #22c55e !important;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.16);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.caisse-card-closed-green:hover {
  transform: translateY(-1px);
  border-color: #4ade80 !important;
  box-shadow: 0 5px 15px rgba(34, 197, 94, 0.28) !important;
}

html.light-theme .caisse-card-unclosed-red,
body.light-theme .caisse-card-unclosed-red {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
  border-color: #ef4444 !important;
  border-left: 5px solid #dc2626 !important;
  color: #7f1d1d !important;
}

html.light-theme .caisse-card-closed-green,
body.light-theme .caisse-card-closed-green {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
  border-color: #22c55e !important;
  border-left: 5px solid #16a34a !important;
  color: #14532d !important;
}

