:root {
  --neon: #00ff88;
  --neon-blue: #00d4ff;
  --alerte-rouge: #ff4757;
  --alerte-orange: #ff9f43;
  --alerte-jaune: #feca57;
  --bg: #0b0f1a;
  --panel-bg: rgba(30, 41, 59, 0.7);
}

body { 
  font-family: 'Segoe UI', Roboto, sans-serif; 
  background: radial-gradient(circle at top right, #1e293b, #0b0f1a); 
  margin: 0; padding: 0; color: white; text-align: center; min-height: 100vh;
  overflow-x: hidden;
}

/* --- DESIGN GÉNÉRAL --- */
.header-area { 
  display: flex; flex-wrap: wrap; justify-content: space-around; align-items: center; 
  padding: 20px 2%; max-width: 1700px; margin: auto; gap: 20px;
}
.casiers-wrapper { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.plan-casier { 
  background: rgba(0,0,0,0.5); padding: 10px; border-radius: 12px; 
  border: 1px solid rgba(255,255,255,0.1); width: 140px; flex-shrink: 0;
}
.label-u { font-size: 10px; font-weight: 800; margin-bottom: 8px; color: var(--neon-blue); letter-spacing: 2px; }
.grille-std { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.grille-c { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.col-c { display: flex; flex-direction: column; gap: 4px; }

.tiroir-box {
  height: 20px; background: #1e293b; border: 1px solid #334155;
  border-radius: 4px; font-size: 9px; color: #64748b;
  display: flex; align-items: center; justify-content: center; transition: 0.3s;
}
.t-long, .t-c-long { height: 18px; margin-top: 5px; background: #0f172a; color: var(--neon); border-color: rgba(0,255,136,0.3); }
.t-long { grid-column: span 4; }
.t-c-long { grid-column: span 3; }

@keyframes flash-neon {
  0% { background: var(--neon); box-shadow: 0 0 5px var(--neon); color: #000; }
  50% { background: #fff; box-shadow: 0 0 20px #fff; color: #000; }
  100% { background: var(--neon); box-shadow: 0 0 5px var(--neon); color: #000; }
}
.active-glow { animation: flash-neon 0.8s infinite; transform: scale(1.05); z-index: 10; border-color: white !important; }

.titre-bloc { width: 100%; max-width: 400px; text-align: center; }
.btn-users {
  background: transparent; color: var(--neon-blue); border: 1px solid var(--neon-blue);
  padding: 6px 18px; border-radius: 10px; font-size: 0.7em; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; transition: 0.3s;
}
.btn-users:hover { background: var(--neon-blue); color: black; }
.btn-logout {
  background: transparent; color: var(--alerte-rouge); border: 1px solid var(--alerte-rouge);
  padding: 6px 18px; border-radius: 10px; font-size: 0.7em; font-weight: 700; letter-spacing: 1px;
  cursor: pointer; transition: 0.3s;
}
.btn-logout:hover { background: var(--alerte-rouge); color: white; }

/* --- MODALE UTILISATEURS --- */
.user-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; margin: 5px 0; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
}
.user-item span { font-size: 0.9em; }
.user-item .btn-action { width: 30px; height: 30px; }
.badge-titre {
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 15px; border-radius: 20px; backdrop-filter: blur(5px);
}
.titre-site { font-size: 1.3em; font-weight: 800; color: #fff; margin: 0; letter-spacing: 1px; text-transform: uppercase; }
.titre-site span { color: var(--neon); }
.slogan { font-size: 0.65em; color: var(--neon-blue); letter-spacing: 2px; margin-top: 5px; opacity: 0.8; }

.casier-panel { 
  background: linear-gradient(145deg, #1e293b, #0f172a); border: 2px solid var(--neon);
  width: 120px; padding: 10px; border-radius: 20px; text-align: center;
}
.casier-numero { font-size: 1.8em; font-weight: 900; color: var(--neon); display: block; }

.search-container { position: relative; width: 95%; max-width: 600px; margin: 20px auto; }
.search-container input {
  width: 100%; padding: 15px 45px; border-radius: 15px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05); color: white; font-size: 16px; outline: none; box-sizing: border-box;
}
.loupe { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--neon-blue); }

.main-content { width: 95%; max-width: 1400px; margin: auto; background: var(--panel-bg); border-radius: 20px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
thead tr { background: rgba(0,0,0,0.6); cursor: pointer; user-select: none; }
th { padding: 15px; color: var(--neon-blue); font-size: 0.75em; text-transform: uppercase; letter-spacing: 1px; }
tr { border-bottom: 1px solid rgba(255,255,255,0.03); cursor: pointer; }
.selected { background: rgba(0, 212, 255, 0.1) !important; border-left: 4px solid var(--neon-blue); }
td { padding: 10px; font-size: 0.9em; }
img.photo-table { width: 45px; height: 45px; object-fit: cover; border-radius: 8px; }
@media (min-width: 769px) {
  .main-content { overflow: visible; }
  td { overflow: visible; }
  img.photo-table { cursor: zoom-in; transition: transform 0.25s ease; position: relative; }
  img.photo-table:hover { transform: scale(4); z-index: 10010; border-radius: 6px; box-shadow: 0 0 20px rgba(0,0,0,0.9), 0 0 0 9999px rgba(0,0,0,0.7); }
}

/* --- BOUTONS ACTIONS TABLEAU --- */
.action-cell { display: flex; gap: 8px; justify-content: center; }
.btn-action {
  width: 36px; height: 36px; border: none; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}
.btn-action svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.btn-action:hover svg { transform: scale(1.15); }
.btn-edit {
  background: rgba(0, 212, 255, 0.1); border: 1px solid rgba(0, 212, 255, 0.3) !important;
}
.btn-edit svg { stroke: var(--neon-blue); fill: none; }
.btn-edit:hover { background: rgba(0, 212, 255, 0.25); box-shadow: 0 0 12px rgba(0, 212, 255, 0.3); }
.btn-delete {
  background: rgba(255, 71, 87, 0.1); border: 1px solid rgba(255, 71, 87, 0.3) !important;
}
.btn-delete svg { stroke: var(--alerte-rouge); fill: none; }
.btn-delete:hover { background: rgba(255, 71, 87, 0.25); box-shadow: 0 0 12px rgba(255, 71, 87, 0.3); }

.btn-add { 
  background: var(--neon); color: #000; border: none; padding: 12px 30px; border-radius: 12px; 
  font-weight: 900; cursor: pointer; margin-bottom: 20px; font-size: 14px; width: 90%; max-width: 300px;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.modal { display: none; position: fixed; z-index: 10002; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); backdrop-filter: blur(10px); }
.modal-content { background: #1e293b; margin: 20px auto; padding: 20px; border-radius: 25px; width: 90%; max-width: 380px; border: 1px solid var(--neon); }
.modal-content input, .modal-content textarea { width: 100%; padding: 10px; margin: 8px 0; border-radius: 10px; border: 1px solid #334155; background: #0b0f1a; color: white; box-sizing: border-box; }

@media (max-width: 768px) {
  .header-area { flex-direction: column; }
  .col-desc-pc { display: none; }
}

/* --- TOAST NOTIFICATION --- */
.toast {
  position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%);
  background: var(--neon); color: black; padding: 12px 30px; border-radius: 30px;
  font-weight: bold; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 10005;
}
.toast.show { bottom: 30px; }
.toast.error { background: var(--alerte-rouge); color: white; }

/* --- MODALE DE CONFIRMATION --- */
.confirm-box { text-align: center; max-width: 320px !important; }
.icon-warning { font-size: 3em; margin-bottom: 10px; }
.confirm-box h3 { margin: 0; color: white; }
.confirm-box p { color: #64748b; font-size: 0.9em; margin-top: 10px; }