/* Dashboard Bob VR Experience (MacBook) */

:root {
  --rouge: #EE1D25;
  --rouge-fonce: #C8141B;
  --rouge-pale: #FDE8E9;
  --vert: #1A9E4B;
  --vert-pale: #E3F6EA;
  --noir: #111111;
  --gris-fonce: #3A3A3A;
  --gris: #6B6B6B;
  --gris-clair: #E4E4E2;
  --fond: #F4F4F2;
  --blanc: #FFFFFF;
  --jaune-pale: #FFF6D6;
  --police: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light; /* champs de saisie clairs même si l'ordinateur est en mode sombre */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--fond);
  color: var(--noir);
  font-family: var(--police);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; color: var(--noir); background: var(--blanc); }
[hidden] { display: none !important; }

h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }

/* ---------- Boutons ---------- */

.bouton { padding: 9px 18px; border-radius: 999px; font-weight: 700; }
.bouton-rouge { background: var(--rouge); color: var(--blanc); }
.bouton-vert { background: var(--vert); color: var(--blanc); }
.bouton-discret { border: 2px solid var(--gris-clair); background: var(--blanc); color: var(--gris-fonce); }
.bouton-lien { color: var(--gris); text-decoration: underline; font-size: 14px; }
.bouton-icone { width: 36px; height: 36px; border-radius: 50%; font-size: 20px; line-height: 1; }
.bouton-icone:hover { background: var(--fond); }

/* ---------- Connexion ---------- */

.connexion {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.connexion-carte {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(440px, 100%);
  padding: 36px;
  border-radius: 24px;
  background: var(--blanc);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .08);
  text-align: center;
}

.connexion-carte img { height: 64px; align-self: center; }
.connexion-carte p { color: var(--gris-fonce); line-height: 1.4; }
.connexion-carte input { padding: 12px 16px; border: 2px solid var(--gris-clair); border-radius: 12px; font-size: 18px; text-align: center; }
.connexion-carte input:focus { outline: none; border-color: var(--rouge); }
.erreur { min-height: 20px; color: var(--rouge-fonce); font-weight: 600; }

/* ---------- En-tête ---------- */

.entete {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px 28px;
  background: var(--blanc);
  border-bottom: 1px solid var(--gris-clair);
}

.marque { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; }
.marque img { height: 36px; }
.marque b { color: var(--rouge); }
.marque small { font-size: 14px; font-weight: 500; color: var(--gris); }

.onglets { display: flex; gap: 4px; }
.onglet { padding: 8px 16px; border-radius: 999px; font-weight: 600; color: var(--gris-fonce); }
.onglet.actif { background: var(--noir); color: var(--blanc); }

.pastille {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rouge);
  color: var(--blanc);
  font-size: 13px;
  font-weight: 700;
}

.journee { display: flex; align-items: center; gap: 6px; }
.journee input { padding: 6px 10px; border: 2px solid var(--gris-clair); border-radius: 10px; }

.etat { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.direct { font-size: 14px; color: var(--gris); }
.direct::before { content: '●'; margin-right: 6px; color: var(--vert); }
.direct.hors-ligne { color: var(--rouge-fonce); font-weight: 600; }
.direct.hors-ligne::before { color: var(--rouge); }

/* ---------- Vues ---------- */

main { padding: 24px 28px 48px; }
.vue { display: none; }
.vue.actif { display: block; }
#vue-commandes.actif { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }

.barre { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.filtres { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--blanc); }
.filtre { padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--gris); }
.filtre.actif { background: var(--fond); color: var(--noir); }
.barre select { padding: 6px 12px; border: 2px solid var(--gris-clair); border-radius: 10px; background: var(--blanc); }

.vide { padding: 40px; text-align: center; color: var(--gris); }

/* ---------- Tableau des commandes ---------- */

.tableau { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--blanc); border-radius: 16px; overflow: hidden; }
.tableau th {
  padding: 10px 12px;
  background: var(--blanc);
  border-bottom: 2px solid var(--fond);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gris);
}
.tableau td { padding: 12px; border-bottom: 1px solid var(--fond); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau .nombre { text-align: right; white-space: nowrap; }

.tableau tr.en-attente { background: #FFFBFB; }
.tableau tr.annulee td { color: var(--gris); text-decoration: line-through; }
.tableau tr.annulee td.statut { text-decoration: none; }
.tableau tr.nouvelle { animation: arrivee 1.2s ease-in-out 3; }
@keyframes arrivee { 50% { background: var(--jaune-pale); } }

.numero { font-weight: 700; font-size: 18px; }
.numero small { display: block; font-size: 12px; font-weight: 600; color: var(--rouge-fonce); }
.client .email { display: block; font-weight: 600; word-break: break-all; }
.client .details { display: flex; gap: 4px; margin-top: 4px; }
.badge { padding: 1px 8px; border-radius: 6px; background: var(--fond); font-size: 12px; font-weight: 600; color: var(--gris-fonce); }
.badge-offres { background: var(--vert-pale); color: var(--vert); }
.references { font-weight: 600; letter-spacing: .02em; }

.montant-modifiable { padding: 2px 6px; border-radius: 6px; border-bottom: 2px dashed var(--gris-clair); font-weight: 700; }
.montant-modifiable:hover { background: var(--fond); }
.saisie-montant { width: 90px; padding: 4px 8px; border: 2px solid var(--rouge); border-radius: 8px; text-align: right; font-weight: 700; }

.statut { white-space: nowrap; }
.bouton-statut {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}
.bouton-statut small { font-weight: 500; }
.bouton-statut.attente { background: var(--rouge); color: var(--blanc); }
button.bouton-statut.attente:hover { background: var(--rouge-fonce); }
.bouton-statut.validee { background: var(--vert-pale); color: var(--vert); }
.bouton-statut.neutre { background: var(--fond); color: var(--gris); }
.bouton-annuler { margin-left: 6px; width: 30px; height: 30px; border-radius: 50%; color: var(--gris); }
.bouton-annuler:hover { background: var(--fond); color: var(--rouge-fonce); }

.envoi { min-width: 150px; }
.envoi .bouton-lien { display: block; margin-top: 2px; font-size: 13px; }
.envoi-etat { font-size: 14px; font-weight: 600; }
.envoi-etat.attente { color: var(--gris); }
.envoi-etat.envoye { color: var(--vert); }
.envoi-etat.erreur { display: block; max-width: 220px; color: var(--rouge-fonce); font-size: 13px; }

/* ---------- Caisse ---------- */

.caisse {
  position: sticky;
  top: 84px;
  padding: 22px;
  border-radius: 16px;
  background: var(--blanc);
}

.totaux { margin: 16px 0 10px; }
.totaux div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--fond); }
.totaux dt { color: var(--gris-fonce); }
.totaux dd { font-weight: 700; }
.totaux .total { border-bottom: 0; font-size: 22px; }
.totaux .total dd { color: var(--rouge); font-weight: 800; }
.compte { color: var(--gris-fonce); }
.caisse h3 { display: flex; justify-content: space-between; margin-top: 18px; }
.offertes { margin-top: 8px; list-style: none; }
.offertes li { display: flex; justify-content: space-between; padding: 4px 0; color: var(--gris-fonce); }
.imprimer { width: 100%; margin-top: 18px; }
.note { margin-top: 12px; font-size: 13px; color: var(--gris); line-height: 1.4; }

/* ---------- Groupes ---------- */

.groupes { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 18px; }
.groupe { padding: 20px; border-radius: 16px; background: var(--blanc); border-left: 6px solid var(--rouge); }
.groupe.statut-payee { border-left-color: var(--vert); }
.groupe.statut-cloturee { border-left-color: var(--gris-clair); opacity: .75; }
.groupe header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.groupe .infos { margin-top: 2px; font-size: 14px; color: var(--gris-fonce); }
.groupe a { color: inherit; }
.champs-groupe { display: grid; grid-template-columns: 160px 1fr; gap: 12px; margin-top: 14px; }
.champs-groupe label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--gris); }
.champs-groupe input, .champs-groupe textarea {
  padding: 8px 10px;
  border: 2px solid var(--gris-clair);
  border-radius: 10px;
  font-size: 16px;
  color: var(--noir);
  resize: vertical;
}
.champs-groupe input:focus, .champs-groupe textarea:focus { outline: none; border-color: var(--rouge); }
.groupe footer { display: flex; align-items: center; gap: 10px; margin-top: 14px; }

/* ---------- Gratuités ---------- */

.categorie { margin-top: 12px; border-radius: 16px; background: var(--blanc); overflow: hidden; }
.categorie summary { display: flex; justify-content: space-between; padding: 16px 20px; font-size: 18px; font-weight: 600; cursor: pointer; }
.categorie .tableau { border-radius: 0; border-top: 1px solid var(--fond); }

/* ---------- Notification ---------- */

.notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--noir);
  color: var(--blanc);
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
}
.notification.succes { background: var(--vert); }
.notification.erreur { background: var(--rouge-fonce); }

/* ---------- Écrans moins larges ---------- */

@media (max-width: 1100px) {
  .entete { flex-wrap: wrap; gap: 12px; }
  #vue-commandes.actif { grid-template-columns: 1fr; }
  .caisse { position: static; }
}

/* ---------- Impression de la clôture de caisse ---------- */

@media print {
  body { background: var(--blanc); }
  .entete, .colonne-principale, .imprimer, .notification, #vue-groupes, #vue-gratuites { display: none !important; }
  main { padding: 0; }
  #vue-commandes.actif { display: block; }
  .caisse { position: static; max-width: 420px; }
}
