/* Direction artistique : console securisee - noir profond, vert phosphorescent, chasse fixe */

:root {
  --fond: #050807;
  --vert: #7dffb8;
  --vert-clair: #b8ffd9;
  --vert-texte: #d9ffe9;
  --vert-doux: rgba(125, 255, 184, 0.6);
  --vert-bord: rgba(125, 255, 184, 0.35);
  --erreur: #ff5f56;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font: 14px/1.6 "Cascadia Mono", Consolas, "Courier New", monospace;
  color: var(--vert);
  background: var(--fond);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(125, 255, 184, 0.30); }

/* ---------- Decor ---------- */

.decor {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.lueur-centre {
  position: absolute;
  width: 980px;
  height: 640px;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  background: radial-gradient(ellipse, rgba(60, 220, 140, 0.09), transparent 65%);
}

.grille {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(125, 255, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 255, 184, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
}

.scanlines {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background: repeating-linear-gradient(0deg, rgba(125, 255, 184, 0.04) 0 1px, transparent 1px 3px);
}

.balayage {
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, rgba(125, 255, 184, 0.045), transparent);
  animation: balayage 9s linear infinite;
}

@keyframes balayage {
  from { top: -140px; }
  to   { top: 100%; }
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 46%, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}

/* ---------- Scene et vues ---------- */

.scene {
  position: relative;
  z-index: 2;
  height: 100vh;
  display: grid;
  place-items: safe center;
  padding: 24px;
  overflow-y: auto;
}

.vue {
  grid-area: 1 / 1;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.vue.masquee {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.vue-connexion { animation: apparition 0.5s ease-out both; }

@keyframes apparition {
  from { opacity: 0; transform: translateY(14px); }
}

/* ---------- Carte console ---------- */

.carte {
  position: relative;
  width: 470px;
  max-width: 94vw;
  padding: 0 0 26px;
  background: rgba(5, 12, 8, 0.9);
  border: 1px solid rgba(125, 255, 184, 0.45);
  box-shadow:
    0 0 40px rgba(60, 220, 140, 0.12),
    inset 0 0 24px rgba(60, 220, 140, 0.04);
}

.coin { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.c1 { top: -2px; left: -2px; border-top: 3px solid var(--vert); border-left: 3px solid var(--vert); }
.c2 { top: -2px; right: -2px; border-top: 3px solid var(--vert); border-right: 3px solid var(--vert); }
.c3 { bottom: -2px; left: -2px; border-bottom: 3px solid var(--vert); border-left: 3px solid var(--vert); }
.c4 { bottom: -2px; right: -2px; border-bottom: 3px solid var(--vert); border-right: 3px solid var(--vert); }

.entete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(125, 255, 184, 0.30);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(125, 255, 184, 0.75);
}

.entete-droite { color: rgba(125, 255, 184, 0.5); }

.corps { padding: 28px 34px 0; }

.titre {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--vert-clair);
}

.curseur {
  display: inline-block;
  width: 12px;
  height: 22px;
  margin-left: 7px;
  vertical-align: -2px;
  background: var(--vert);
  animation: clignote 1.1s steps(1) infinite;
}

@keyframes clignote { 50% { opacity: 0; } }

.sous {
  margin: 0 0 26px;
  font-size: 12px;
  color: var(--vert-doux);
}

/* ---------- Formulaire ---------- */

.groupe { margin-bottom: 18px; }

.groupe label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(184, 255, 217, 0.85);
}

.groupe label::before { content: "> "; color: var(--vert); }

.champ { position: relative; }

input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 14px;
  font: inherit;
  color: var(--vert-texte);
  caret-color: var(--vert);
  background: rgba(125, 255, 184, 0.05);
  border: 1px solid var(--vert-bord);
  border-radius: 0;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input::placeholder { color: rgba(125, 255, 184, 0.30); }

input:hover { border-color: rgba(125, 255, 184, 0.55); }

input:focus {
  border-color: var(--vert);
  background: rgba(125, 255, 184, 0.08);
  box-shadow:
    0 0 0 1px rgba(125, 255, 184, 0.35),
    0 0 22px rgba(125, 255, 184, 0.18);
}

input.invalide {
  border-color: rgba(255, 95, 86, 0.75);
  box-shadow: 0 0 0 1px rgba(255, 95, 86, 0.35), 0 0 18px rgba(255, 95, 86, 0.15);
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px #081009 inset;
  -webkit-text-fill-color: var(--vert-texte);
}

input:disabled {
  opacity: 0.55;
  color: var(--vert-doux);
}

.oeil {
  position: absolute;
  right: 7px;
  top: 50%;
  translate: 0 -50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  cursor: pointer;
}

.oeil svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--vert-doux);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.oeil:hover svg { stroke: var(--vert); }

.oeil:focus-visible {
  outline: 1px solid var(--vert);
  outline-offset: 2px;
}

.cachee { display: none !important; }

.message-erreur {
  display: none;
  margin: -2px 0 16px;
  padding: 9px 12px;
  font-size: 12px;
  color: #ffb3ae;
  background: rgba(255, 95, 86, 0.07);
  border: 1px solid rgba(255, 95, 86, 0.45);
}

.message-erreur.visible { display: block; }

.message-erreur::before {
  content: "ERREUR :: ";
  font-weight: 700;
  color: var(--erreur);
}

.message-info {
  display: none;
  margin: -2px 0 16px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--vert-clair);
  background: rgba(125, 255, 184, 0.06);
  border: 1px solid rgba(125, 255, 184, 0.45);
}

.message-info.visible { display: block; }

.message-info::before {
  content: "OK :: ";
  font-weight: 700;
  color: var(--vert);
}

/* ---------- Bouton principal ---------- */

.bouton {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  border: 1px solid var(--vert);
  border-radius: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #04110a;
  cursor: pointer;
  background: var(--vert);
  box-shadow: 0 0 28px rgba(125, 255, 184, 0.35);
  transition: box-shadow 0.15s, filter 0.15s, transform 0.1s;
}

.bouton:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 40px rgba(125, 255, 184, 0.5);
}

.bouton:active { transform: translateY(1px); }

.bouton:focus-visible {
  outline: 1px solid var(--vert);
  outline-offset: 3px;
}

.bouton.chargement {
  pointer-events: none;
  filter: saturate(0.8) brightness(0.92);
}

.points { display: none; }

.bouton.chargement .points { display: inline; }

.bouton.chargement .points::after {
  content: "";
  animation: points 1.2s infinite;
}

@keyframes points {
  0%  { content: ""; }
  25% { content: " ."; }
  50% { content: " .."; }
  75% { content: " ..."; }
}

/* ---------- Liens ---------- */

.liens {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
}

.liens a {
  color: rgba(184, 255, 217, 0.7);
  text-decoration: none;
  transition: color 0.15s, text-shadow 0.15s;
}

.liens a::before { content: "["; }
.liens a::after  { content: "]"; }

.liens a:hover {
  color: var(--vert);
  text-shadow: 0 0 12px rgba(125, 255, 184, 0.5);
}

.liens a.lien-fort { color: var(--vert); }

.liens-centre { justify-content: center; }

/* ---------- Barre de statut ---------- */

.statut {
  margin: 24px 34px 0;
  padding-top: 13px;
  border-top: 1px dashed rgba(125, 255, 184, 0.30);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(125, 255, 184, 0.5);
  display: flex;
  justify-content: space-between;
}

.temoin {
  display: inline-block;
  width: 7px;
  height: 11px;
  margin-left: 4px;
  vertical-align: -1px;
  background: var(--vert);
  animation: clignote 1.4s steps(1) infinite;
}

/* ---------- Vue gestion (tableau de bord) ---------- */

.vue-gestion {
  align-self: start;
  width: min(1160px, 96vw);
  padding-top: 8px;
}

.barre {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(5, 12, 8, 0.9);
  border: 1px solid rgba(125, 255, 184, 0.45);
  box-shadow: 0 0 30px rgba(60, 220, 140, 0.10);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(125, 255, 184, 0.75);
}

.barre-droite {
  display: flex;
  align-items: center;
  gap: 16px;
  text-transform: none;
  letter-spacing: 0.06em;
}

.barre-utilisateur { color: var(--vert-clair); }

.lien-bouton {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: rgba(184, 255, 217, 0.7);
  cursor: pointer;
  transition: color 0.15s, text-shadow 0.15s;
}

.lien-bouton:hover {
  color: var(--vert);
  text-shadow: 0 0 12px rgba(125, 255, 184, 0.5);
}

.lien-bouton.danger:hover {
  color: var(--erreur);
  text-shadow: 0 0 12px rgba(255, 95, 86, 0.5);
}

/* -- Corps a deux colonnes : menu lateral + section affichee -- */

.gestion-corps {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 14px;
}

.lateral {
  width: 185px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: rgba(5, 12, 8, 0.9);
  border: 1px solid rgba(125, 255, 184, 0.45);
  box-shadow: 0 0 30px rgba(60, 220, 140, 0.10);
}

.lateral-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  font: inherit;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: rgba(184, 255, 217, 0.6);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.lateral-item::before {
  content: "› ";
  color: rgba(125, 255, 184, 0.4);
}

.lateral-item:hover {
  color: var(--vert);
  background: rgba(125, 255, 184, 0.05);
}

.lateral-item.actif {
  color: var(--vert-clair);
  background: rgba(125, 255, 184, 0.08);
  border-left-color: var(--vert);
  text-shadow: 0 0 12px rgba(125, 255, 184, 0.35);
}

.sections {
  flex: 1;
  min-width: 0;
}

.sections .panneau { margin-top: 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0;
}

.stat {
  padding: 14px 16px;
  background: rgba(5, 12, 8, 0.85);
  border: 1px solid rgba(125, 255, 184, 0.30);
}

.stat-valeur {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--vert-clair);
}

.stat-nom {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(125, 255, 184, 0.55);
}

.stat-alerte { border-color: rgba(255, 180, 84, 0.5); }
.stat-alerte .stat-valeur { color: #ffb454; }

.panneau {
  background: rgba(5, 12, 8, 0.9);
  border: 1px solid rgba(125, 255, 184, 0.45);
  box-shadow: 0 0 40px rgba(60, 220, 140, 0.10);
}

.panneau-entete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(125, 255, 184, 0.30);
}

.panneau-entete h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vert-clair);
}

.bouton-compact {
  width: auto;
  height: 36px;
  margin: 0;
  padding: 0 16px;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.tableau-cadre { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  padding: 10px 16px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(125, 255, 184, 0.55);
  border-bottom: 1px solid rgba(125, 255, 184, 0.25);
}

td {
  padding: 11px 16px;
  color: var(--vert-texte);
  border-bottom: 1px solid rgba(125, 255, 184, 0.12);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: rgba(125, 255, 184, 0.04); }

th.nombre, td.nombre { text-align: right; }

.stock-zero { color: #ffb454; }

/* -- Produits de test : visibles, essayables, mais hors de tous les chiffres -- */

.badge-test {
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffb454;
  border: 1px dashed rgba(255, 180, 84, 0.5);
  border-radius: 3px;
}

tr.ligne-test td { opacity: 0.65; }

.suffixe-doux { color: rgba(125, 255, 184, 0.5); }

.entete-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* -- Vue vendeur : juste sa paye -- */

.paye-vendeur {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 16px;
}

.paye-principale {
  flex: 1;
  min-width: 220px;
  padding: 16px 18px;
  background: rgba(125, 255, 184, 0.07);
  border: 1px solid rgba(125, 255, 184, 0.35);
}

.paye-principale .stat-valeur {
  font-size: 34px;
  color: var(--vert);
  text-shadow: 0 0 20px rgba(125, 255, 184, 0.35);
}

.paye-secondaire {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 1;
  min-width: 220px;
}

.paye-secondaire > div {
  padding: 16px 18px;
  background: rgba(5, 12, 8, 0.85);
  border: 1px solid rgba(125, 255, 184, 0.30);
}

/* -- Synchro -- */

.sync-intro {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--vert-doux);
}

.sync-dossier {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(125, 255, 184, 0.05);
  border: 1px solid var(--vert-bord);
}

.sync-chemin {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--vert-texte);
  word-break: break-all;
}

.sync-boutons {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 6px;
}

.sync-boutons .bouton-compact { flex: 1; height: 44px; }
.sync-boutons .bouton-fantome { height: 44px; }

.sync-note {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: rgba(255, 180, 84, 0.7);
}

/* -- Verrou par cle : ecran de blocage plein ecran -- */

.verrou-cle {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background: rgba(3, 6, 4, 0.98);
  backdrop-filter: blur(6px);
}

.verrou-cadenas {
  font-size: 64px;
  filter: drop-shadow(0 0 24px rgba(255, 180, 84, 0.5));
}

.verrou-titre {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffb454;
}

.verrou-texte {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--vert-doux);
}

.verrou-points {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.verrou-points span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 180, 84, 0.8);
  animation: verrou-pulse 1.2s ease-in-out infinite;
}

.verrou-points span:nth-child(2) { animation-delay: 0.2s; }
.verrou-points span:nth-child(3) { animation-delay: 0.4s; }

@keyframes verrou-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

.case {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--vert-doux);
  cursor: pointer;
}

.case input[type="checkbox"] {
  width: 15px;
  height: 15px;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  accent-color: #7dffb8;
  cursor: pointer;
}

th.actions, td.actions { text-align: right; white-space: nowrap; }

td.actions .lien-bouton { margin-left: 12px; }

.vide {
  display: none;
  padding: 26px 16px;
  text-align: center;
  font-size: 12.5px;
  color: rgba(125, 255, 184, 0.5);
}

.vide.visible { display: block; }

.panneau-equipe { margin-top: 14px; }
.panneau-ventes { margin-top: 14px; }

.entete-note {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(125, 255, 184, 0.55);
}

.sous-entete {
  margin-top: 4px;
  padding: 12px 16px 2px;
  border-top: 1px dashed rgba(125, 255, 184, 0.2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(125, 255, 184, 0.55);
}

.vente-produit {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--vert-doux);
}

.vente-produit span { color: var(--vert-clair); }

.vente-total {
  margin: -4px 0 14px;
  font-size: 12.5px;
  color: var(--vert-clair);
}

.pied-gestion {
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(125, 255, 184, 0.4);
}

/* ---------- Fenetre modale produit ---------- */

.voile-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 4, 3, 0.72);
  transition: opacity 0.25s;
}

.voile-modal.masquee {
  opacity: 0;
  pointer-events: none;
}

.modal-carte {
  width: min(460px, 94vw);
  background: rgba(5, 12, 8, 0.97);
  border: 1px solid rgba(125, 255, 184, 0.5);
  box-shadow: 0 0 60px rgba(60, 220, 140, 0.20);
  padding-bottom: 24px;
}

.corps-modal { padding-top: 22px; }

.corps-modal .groupe { margin-bottom: 16px; }

.rang {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.champ select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  font: inherit;
  color: var(--vert-texte);
  background: rgba(125, 255, 184, 0.05);
  border: 1px solid var(--vert-bord);
  border-radius: 0;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.champ select:focus {
  border-color: var(--vert);
  box-shadow: 0 0 0 1px rgba(125, 255, 184, 0.35);
}

.champ select option {
  background: #0a120c;
  color: var(--vert-texte);
}

.modal-boutons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.bouton-modal { flex: 1; margin-top: 0; }

.bouton-fantome-modal { height: 48px; padding: 0 20px; }

.bouton-fantome {
  padding: 12px 22px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--vert);
  background: transparent;
  border: 1px solid var(--vert-bord);
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.bouton-fantome::before { content: "[ "; }
.bouton-fantome::after  { content: " ]"; }

.bouton-fantome:hover {
  border-color: var(--vert);
  background: rgba(125, 255, 184, 0.06);
  box-shadow: 0 0 24px rgba(125, 255, 184, 0.2);
}

/* ---------- Notes de marge et toast ---------- */

.note {
  position: fixed;
  bottom: 16px;
  z-index: 3;
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(125, 255, 184, 0.35);
}

.note-gauche { left: 22px; }
.note-droite { right: 22px; }

.toast {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 40px;
  padding: 11px 18px;
  font-size: 12.5px;
  color: var(--vert-texte);
  background: rgba(5, 12, 8, 0.96);
  border: 1px solid var(--vert-bord);
  box-shadow: 0 0 30px rgba(60, 220, 140, 0.18);
  transform: translateX(-50%);
  transition: opacity 0.3s, transform 0.3s;
}

.toast::before {
  content: "[info] ";
  color: var(--vert);
  font-weight: 700;
}

.toast.masquee {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  pointer-events: none;
}

/* ---------- Ajustements ---------- */

@media (max-height: 720px) {
  .corps { padding-top: 22px; }
  .titre { font-size: 22px; }
  .sous { margin-bottom: 20px; }
  .statut { margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
