/* ===========================================================================
   styles.css — Bolak Paris Souvenirs
   Interface responsive : sidebar de navigation + contenu, tiroir sur mobile.
   =========================================================================== */

:root {
  --fond: #f3efe6;
  --surface: #ffffff;
  --encre: #1b1712;
  --encre-douce: #5c554a;
  --muet: #988f7e;
  --bord: #e8e1d3;
  --bord-fort: #d9cfbc;
  --primaire: #c0922e;          /* doré BOLAK */
  --primaire-fonce: #9c7523;
  --or-clair: #d8b45a;
  --bleu: #8a6a1f;              /* accent doré foncé (avatars) */
  --anthracite: #1b1712;        /* noir chaud (sidebar) */
  --anthracite-2: #241f18;
  --vert: #2f8a55;
  --orange: #cf8a1e;
  --rouge: #c0453b;
  --ombre: 0 1px 3px rgba(30,24,12,.07), 0 6px 20px rgba(30,24,12,.06);
  --ombre-forte: 0 12px 44px rgba(20,16,8,.24);
  --serif: "Iowan Old Style", Georgia, "Times New Roman", Palatino, serif;
  --rayon: 12px;
  --rayon-s: 8px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--fond);
  color: var(--encre);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
a { color: var(--primaire); text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: 15px; }
.chargement { display: grid; place-items: center; height: 100vh; color: var(--muet); }
.muet { color: var(--muet); }
.rouge { color: var(--rouge); font-weight: 700; }
.orange { color: var(--orange); font-weight: 700; }
.centre { text-align: center; margin-top: 20px; }

/* -- Boutons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--rayon-s);
  padding: 9px 16px; font-weight: 600; cursor: pointer; background: #ececf1; color: var(--encre);
  transition: filter .15s, background .15s, transform .05s; white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primaire { background: var(--primaire); color: #23190a; font-weight: 700; }
.btn--primaire:hover { background: var(--primaire-fonce); color: #fff; filter: none; }
.btn--secondaire { background: #fff; border-color: var(--bord-fort); color: var(--encre); }
.btn--danger { background: var(--rouge); color: #fff; }
.btn--danger-doux { background: #fdeaea; color: var(--rouge); }
.btn--petit { padding: 5px 11px; font-size: 13px; border-radius: 6px; }
.btn--bloc { width: 100%; }
.btn--grand { padding: 14px; font-size: 16px; }

/* -- Badges de statut ---------------------------------------------------- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: #eceef3; color: #444; white-space: nowrap; }
.st-attente { background: #fff3d6; color: #9a6a00; }
.st-validee { background: #dcecff; color: #1a53b0; }
.st-production { background: #e6e0ff; color: #5b34c9; }
.st-prete { background: #d8f5e3; color: #167d43; }
.st-expediee { background: #dfe3e8; color: #4a5560; }
.st-annulee { background: #f3d9d9; color: #a53030; }

/* ===========================================================================
   Écran de connexion
   =========================================================================== */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1000px 700px at 50% -15%, #fbf8f1 0%, #ece4d3 65%, #e4dac6 100%); }
.login-form { width: 100%; max-width: 400px; background: var(--surface);
  border: 1px solid var(--bord); border-radius: 18px; padding: 30px 28px 34px; box-shadow: var(--ombre-forte); }
.login-marque { text-align: center; margin-bottom: 20px; }
.login-logo { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 8px; }
.login-sous { color: var(--muet); font-size: 14px; margin: 4px 0 0; letter-spacing: .3px; }
.login-erreur { display: none; background: #fbe9e7; color: var(--rouge); border-radius: var(--rayon-s);
  padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.login-erreur.visible { display: block; }
.login-form .btn { margin-top: 8px; }

/* Marque de la barre latérale (tour Eiffel dorée + nom en sérif) */
.marque-eiffel { width: 30px; height: 40px; flex-shrink: 0; }
.marque .nom-serif { font-family: var(--serif); font-size: 17px; letter-spacing: 1px; color: #fff; line-height: 1.05; }
.marque-logo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primaire), var(--primaire-fonce)); color: #23190a; font-weight: 800; letter-spacing: .5px; }
.marque-logo.grand { width: 56px; height: 56px; font-size: 20px; border-radius: 14px; }

/* ===========================================================================
   Coquille (sidebar + contenu)
   =========================================================================== */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--anthracite); color: #d9d9e2;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .marque { display: flex; align-items: center; gap: 10px; padding: 18px 18px; color: #fff; }
.sidebar .marque strong { display: block; font-size: 15px; }
.sidebar .marque small { color: var(--or-clair); font-size: 11px; text-transform: uppercase; letter-spacing: 2px; }

.nav-liste { flex: 1; padding: 8px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: var(--rayon-s);
  color: #c7c7d3; margin-bottom: 2px; cursor: pointer; position: relative; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.actif { background: var(--primaire); color: #23190a; }
.nav-item.actif .nav-label { font-weight: 700; }
.nav-icone { width: 22px; text-align: center; font-size: 16px; }
.nav-label { flex: 1; font-weight: 600; font-size: 14px; }
.nav-badge { display: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--primaire); color: #fff; font-size: 12px; font-weight: 700; align-items: center; justify-content: center; }
.nav-item.actif .nav-badge { background: #fff; color: var(--primaire); }
.nav-badge.visible { display: inline-flex; }

.sidebar-pied { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.user-carte { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--bleu); color: #fff;
  display: grid; place-items: center; font-weight: 700; }
.user-carte strong { display: block; font-size: 14px; color: #fff; }
.user-carte small { color: #b8a878; font-size: 12px; }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: var(--surface);
  border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 20; }
.topbar-titre { font-size: 19px; font-weight: 600; flex: 1; font-family: var(--serif); letter-spacing: .3px; }
.role-pastille { background: #eceef3; color: var(--encre-douce); padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.burger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; padding: 4px 8px; }
.backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
.backdrop.visible { display: block; }

.contenu { padding: 24px; max-width: 1200px; width: 100%; }
.erreur-bloc { background: #fdeaea; color: var(--rouge); padding: 14px; border-radius: var(--rayon-s); }

.page-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-tete h1 { font-size: 24px; font-family: var(--serif); font-weight: 600; letter-spacing: .3px; }
.page-actions { display: flex; gap: 8px; }
.sous-titre { margin: -8px 0 16px; }

/* -- KPI & cartes -------------------------------------------------------- */
.kpi-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px 18px; box-shadow: var(--ombre); }
.kpi--alerte { border-color: #f2c98a; background: #fffaf0; }
.kpi-titre { color: var(--muet); font-size: 13px; font-weight: 600; }
.kpi-valeur { font-size: 28px; font-weight: 800; margin-top: 4px; }
.kpi-sous { color: var(--muet); font-size: 12px; margin-top: 2px; }

.flux-statuts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.flux-item { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--bord);
  padding: 8px 14px; border-radius: 999px; box-shadow: var(--ombre); }
.flux-item strong { font-size: 16px; }

.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); }
.carte h3 { font-size: 16px; margin-bottom: 12px; }
.carte h4 { font-size: 14px; margin: 16px 0 8px; }
.lien-bloc { display: inline-block; margin-top: 12px; font-weight: 600; font-size: 14px; }

/* -- Tableaux ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 11px 14px; background: #fafafc; border-bottom: 1px solid var(--bord);
  font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muet); font-weight: 700; white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid #f0f0f4; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #fafaff; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl small { font-size: 12px; }
.td-vide { text-align: center; color: var(--muet); padding: 26px !important; }
.col-actions { text-align: right; white-space: nowrap; width: 1%; }
.actions-ligne { display: inline-flex; gap: 6px; }
.ligne-alerte { background: #fffaf0 !important; }

/* -- Onglets ------------------------------------------------------------- */
.onglets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.onglet { background: var(--surface); border: 1px solid var(--bord-fort); border-radius: 999px; padding: 7px 14px;
  cursor: pointer; font-weight: 600; font-size: 14px; color: var(--encre-douce); display: inline-flex; align-items: center; gap: 6px; }
.onglet:hover { border-color: var(--muet); }
.onglet.actif { background: var(--anthracite); color: #fff; border-color: var(--anthracite); }
.onglet-n { background: var(--primaire); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }

/* -- Barre outils / recherche ------------------------------------------- */
.barre-outils { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.recherche, .select-cat { padding: 9px 12px; border: 1px solid var(--bord-fort); border-radius: var(--rayon-s); background: #fff; }
.recherche { flex: 1; min-width: 180px; }
.barre-outils .btn.actif { background: var(--anthracite); color: #fff; }

/* -- État vide ----------------------------------------------------------- */
.vide { text-align: center; padding: 48px 20px; color: var(--muet); }
.vide-icone { font-size: 42px; margin-bottom: 8px; }

/* -- Formulaires --------------------------------------------------------- */
.champ { display: block; margin-bottom: 14px; }
.champ-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--encre-douce); }
.champ .req { color: var(--primaire); }
.champ input:not([type=checkbox]), .champ select, .champ textarea,
.mdp-ligne input, .articles-editeur input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--bord-fort); border-radius: var(--rayon-s);
  background: #fff; color: var(--encre); }
.champ textarea { resize: vertical; }
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: 2px solid var(--primaire); outline-offset: -1px; border-color: var(--primaire); }
.champ-aide { display: block; color: var(--muet); font-size: 12px; margin-top: 4px; }
.champ--case { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.champ--case input { width: 18px; height: 18px; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* Éditeur d'articles / variantes */
.articles-editeur { border: 1px dashed var(--bord-fort); border-radius: var(--rayon-s); padding: 12px; margin-bottom: 14px; }
.article-ligne { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.article-ligne input { flex: 1; min-width: 90px; }
.mini-label { font-size: 11px; color: var(--muet); display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }

/* Éditeur de photo produit */
.photo-editeur { display: flex; gap: 14px; align-items: flex-start; }
.photo-cadre { width: 118px; height: 118px; border: 1px solid var(--bord-fort); border-radius: var(--rayon-s);
  background: #faf7f0; overflow: hidden; flex-shrink: 0; display: grid; place-items: center; }
.photo-apercu { width: 100%; height: 100%; object-fit: cover; display: none; }
.photo-vide { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muet); font-size: 12px; }
.photo-vide-icone { font-size: 26px; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding-top: 2px; }

/* Miniatures catalogue (bureau) */
.col-photo { width: 56px; }
.mini-photo { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--bord); display: block; }
.mini-photo--vide { display: grid; place-items: center; background: #faf7f0; color: var(--muet); font-size: 18px; }

/* -- Modale -------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(20,20,30,.5); display: grid; place-items: center;
  z-index: 60; padding: 16px; animation: fondu .12s ease; }
@keyframes fondu { from { opacity: 0; } }
.modale { background: var(--surface); border-radius: 14px; width: 100%; max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: var(--ombre-forte); animation: surgir .16s ease; }
@keyframes surgir { from { transform: translateY(10px); opacity: 0; } }
.modale-tete { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--bord); }
.modale-tete h3 { font-size: 17px; }
.modale-fermer { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muet); padding: 4px 8px; }
.modale-corps { padding: 20px; overflow-y: auto; }
.modale-pied { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--bord); flex-wrap: wrap; }
.confirm-texte { margin: 0; }

/* -- Détail commande ----------------------------------------------------- */
.detail-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin-bottom: 16px; }
.detail-meta .muet { display: block; font-size: 12px; margin-bottom: 2px; }
.detail-totaux { display: flex; justify-content: flex-end; gap: 20px; margin-top: 14px; }
.detail-totaux .grand { font-size: 17px; }
.note-bloc { margin-top: 14px; background: #faf7ef; border: 1px solid #efe6cf; border-radius: var(--rayon-s); padding: 10px 12px; font-size: 14px; }

/* -- Réglages ------------------------------------------------------------ */
.mdp-ligne { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.mdp-ligne input { flex: 1; min-width: 160px; }
.mdp-role { width: 90px; font-weight: 600; font-size: 14px; }
.mdp-bloc-perso { margin-top: 8px; border-top: 1px solid var(--bord); padding-top: 8px; }

/* ===========================================================================
   Catalogue commercial (cartes tactiles)
   =========================================================================== */
.compteur-panier { background: #fff; color: var(--primaire); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 800; margin-left: 2px; }
.cat-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.carte-produit { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); overflow: hidden; }
.carte-photo-cadre { margin: -16px -16px 12px; height: 168px; background: #faf7f0; overflow: hidden; border-bottom: 1px solid var(--bord); }
.carte-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.carte-tete strong { font-size: 16px; }
.carte-tete small { display: block; color: var(--muet); font-size: 12px; }
.prix-etiq { background: #f6eecf; color: var(--primaire-fonce); font-weight: 800; padding: 4px 10px; border-radius: var(--rayon-s); white-space: nowrap; }
.carte-desc { color: var(--encre-douce); font-size: 13px; margin: 8px 0 4px; }
.carte-corps { margin-top: 10px; border-top: 1px solid var(--bord); padding-top: 8px; }
.art-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; }
.art-ligne + .art-ligne { border-top: 1px dashed var(--bord); }
.art-info strong { font-size: 14px; }
.art-info small { display: block; font-size: 12px; }
.art-action { display: flex; align-items: center; gap: 6px; }
.qte-input { width: 58px; padding: 7px 8px; border: 1px solid var(--bord-fort); border-radius: 6px; text-align: center; }

/* -- Panier -------------------------------------------------------------- */
.panier-ligne { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--bord);
  border-radius: var(--rayon); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--ombre); }
.pl-info { flex: 1; min-width: 0; }
.pl-info strong { display: block; }
.pl-info small { display: block; }
.pl-qte { display: flex; align-items: center; gap: 8px; }
.pl-qte span { min-width: 22px; text-align: center; font-weight: 700; }
.pas { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--bord-fort); background: #fff; cursor: pointer; font-size: 18px; line-height: 1; }
.pl-total { width: 90px; text-align: right; font-weight: 700; }
.pl-suppr { background: none; border: none; color: var(--muet); cursor: pointer; font-size: 16px; padding: 4px; }
.pl-suppr:hover { color: var(--rouge); }
.panier-pied { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px; margin-top: 16px; box-shadow: var(--ombre); }
.panier-totaux { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--bord); flex-wrap: wrap; }
.panier-totaux .grand { font-size: 19px; }
.grand-nombre { font-size: 18px; }

/* ===========================================================================
   Toasts
   =========================================================================== */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(92vw, 380px); }
.toast { background: var(--anthracite); color: #fff; padding: 12px 16px; border-radius: var(--rayon-s);
  box-shadow: var(--ombre-forte); font-size: 14px; font-weight: 500; animation: entree .2s ease; }
@keyframes entree { from { transform: translateX(20px); opacity: 0; } }
.toast.part { opacity: 0; transform: translateX(20px); transition: all .3s; }
.toast--succes { background: var(--vert); }
.toast--alerte { background: var(--rouge); }
.toast--info { background: var(--bleu); }

/* ===========================================================================
   Lightbox (image en grand — double-clic)
   =========================================================================== */
.lightbox { position: fixed; inset: 0; background: rgba(15,12,8,.9); z-index: 95;
  display: grid; place-items: center; padding: 28px; animation: fondu .12s ease; cursor: zoom-out; }
.lightbox-img { max-width: 94vw; max-height: 86vh; object-fit: contain; border-radius: 8px;
  box-shadow: var(--ombre-forte); background: #fff; cursor: default; }
.lightbox-fermer { position: fixed; top: 18px; right: 22px; width: 42px; height: 42px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.16); color: #fff; font-size: 20px; cursor: pointer; }
.lightbox-fermer:hover { background: rgba(255,255,255,.3); }
.lightbox-legende { position: fixed; bottom: 22px; left: 0; right: 0; text-align: center; color: #f3efe6;
  font-family: var(--serif); font-size: 17px; letter-spacing: .3px; }
.mini-photo:not(.mini-photo--vide) { cursor: zoom-in; }
.carte-photo { cursor: zoom-in; }
.photo-apercu { cursor: zoom-in; }

/* ===========================================================================
   Responsive
   =========================================================================== */
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.ouverte { transform: translateX(0); box-shadow: var(--ombre-forte); }
  .burger { display: block; }
  .contenu { padding: 16px; }
  .deux-colonnes { grid-template-columns: 1fr; }
  .grille-2 { grid-template-columns: 1fr; }
  .role-pastille { display: none; }
  .page-tete h1 { font-size: 19px; }
}
@media (max-width: 520px) {
  .cat-grille { grid-template-columns: 1fr; }
  .pl-total { width: auto; }
  .modale-pied { flex-direction: column-reverse; }
  .modale-pied .btn { width: 100%; }
}
