/* =====================================================================
   Dounia-Services — administration
   ===================================================================== */
:root {
  --vert: #0b6b45; --vert-fonce: #075538; --vert-nuit: #052f22; --vert-pale: #eaf5ef; --lime: #b8d957; --or: #d6a84a; --or-pale: #fff6e2;
  --encre: #15221c; --texte-2: #61706a; --fond: #f2f6f3; --ligne: #e0e8e3; --rouge: #b3392b; --rouge-pale: #fff0ed; --bleu: #2f5596;
  --rayon: 14px; --ombre: 0 4px 18px rgba(5, 47, 34, .06); --police: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; --titres: Manrope, Inter, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--police); color: var(--encre); background: var(--fond); font-size: 14.5px; line-height: 1.55; }
a { color: var(--vert); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--ligne); margin: 14px 0; }
.nowrap { white-space: nowrap; } .droite { text-align: right !important; }
.discret { color: var(--texte-2); font-weight: 400; }
small.discret { display: block; font-size: 12.5px; margin-top: 2px; }
:focus-visible { outline: 3px solid rgba(11, 107, 69, .35); outline-offset: 2px; }

/* ---------- Structure ---------- */
.barre-laterale { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--vert-nuit); color: #cfe0d7; padding: 20px 14px; overflow-y: auto; z-index: 50; }
.admin-marque { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 20px; text-decoration: none !important; }
.admin-marque img { width: 42px; height: 42px; border-radius: 11px; }
.admin-marque strong { display: block; font: 800 16px var(--titres); }
.admin-marque small { display: block; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: #9fb8ad; }
.admin-marque.sombre { color: var(--vert-nuit); padding: 0 0 22px; } .admin-marque.sombre small { color: var(--texte-2); }
.barre-laterale nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #cfe0d7; font-weight: 600; font-size: 14px; margin-bottom: 2px; text-decoration: none; }
.barre-laterale nav a i { width: 18px; text-align: center; color: #8fb3a3; }
.barre-laterale nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.barre-laterale nav a.actif { background: var(--vert); color: #fff; } .barre-laterale nav a.actif i { color: var(--lime); }
.barre-laterale hr { border-color: rgba(255, 255, 255, .1); }
.barre-laterale .deconnexion:hover { background: rgba(179, 57, 43, .25); }
.compteur { margin-left: auto; background: var(--lime); color: var(--vert-nuit); font-size: 11.5px; font-weight: 800; border-radius: 10px; padding: 1px 8px; }
.admin-principal { margin-left: 250px; min-height: 100vh; display: flex; flex-direction: column; }
.admin-barre { position: sticky; top: 0; z-index: 40; height: 60px; background: #fff; border-bottom: 1px solid var(--ligne); display: flex; align-items: center; justify-content: flex-end; padding: 0 28px; gap: 14px; }
.bouton-menu { display: none; border: 0; background: none; font-size: 21px; color: var(--vert); cursor: pointer; margin-right: auto; }
.admin-utilisateur { font-weight: 600; color: var(--texte-2); }
.admin-contenu { padding: 28px; flex: 1; width: 100%; max-width: 1400px; }
.admin-pied { padding: 18px 28px; font-size: 12.5px; color: var(--texte-2); }
.voile { display: none; }

/* ---------- Titres ---------- */
.titre-page { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.titre-page h1 { font: 800 27px/1.2 var(--titres); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.titre-page p { color: var(--texte-2); margin-top: 4px; max-width: 760px; }
.titre-page .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.retour { display: inline-block; font-size: 13.5px; color: var(--texte-2); margin-bottom: 6px; }

/* ---------- Boutons ---------- */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none !important; line-height: 1.25; transition: background .15s, box-shadow .15s; white-space: nowrap; }
.bouton:disabled { opacity: .5; cursor: not-allowed; }
.bouton-principal { background: var(--vert); color: #fff; } .bouton-principal:hover { background: var(--vert-fonce); }
.bouton-clair { background: #fff; color: var(--vert-fonce); border-color: #cfdcd4; } .bouton-clair:hover { background: var(--vert-pale); }
.bouton-lien { background: none; color: var(--texte-2); } .bouton-lien:hover { color: var(--vert); }
.bouton-lien.danger, .danger { color: var(--rouge); }
.bouton-danger { background: var(--rouge); color: #fff; } .bouton-danger:hover { background: #962c20; }
.bouton-danger-clair { background: var(--rouge-pale); color: var(--rouge); border-color: #f4d2cc; } .bouton-danger-clair:hover { background: #ffe0da; }
.bouton-or { background: var(--or-pale); color: #8a5a00; border-color: #efd9a6; }
.bouton-whatsapp { background: #1fa855; color: #fff; } .bouton-whatsapp:hover { background: #178a45; }
.bouton-petit { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.bouton-bloc { width: 100%; }

/* ---------- Alertes ---------- */
.alerte { padding: 12px 15px; border-radius: 11px; margin-bottom: 18px; font-weight: 600; border: 1px solid; }
.alerte a { font-weight: 800; }
.alerte-succes { background: #e8f7ef; color: #075538; border-color: #c4e6d3; }
.alerte-erreur { background: var(--rouge-pale); color: #9b2f22; border-color: #f4d2cc; }
.alerte-info { background: var(--or-pale); color: #6e4b00; border-color: #efd9a6; }

/* ---------- Cartes et grilles ---------- */
.carte { background: #fff; border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 20px; box-shadow: var(--ombre); margin-bottom: 20px; }
.carte h2 { font: 800 17px var(--titres); margin-bottom: 14px; }
.carte-titre { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.carte-titre h2 { margin: 0; } .carte-titre a { font-size: 13.5px; font-weight: 700; }
.carte-tableau { padding: 0; overflow: hidden; }
.carte-tableau .carte-titre { padding: 16px 20px 0; }
.carte-etroite { max-width: 560px; }
.deux-colonnes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.deux-colonnes-large { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
.pile > .carte:last-child { margin-bottom: 0; }
.deux-colonnes > .carte, .deux-colonnes > .pile { margin-bottom: 20px; }
.grille-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; background: #fff; border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); color: var(--encre); text-decoration: none !important; }
a.stat:hover { border-color: var(--vert); }
.stat i { grid-row: span 2; width: 42px; height: 42px; border-radius: 12px; background: var(--vert-pale); color: var(--vert); display: grid; place-items: center; font-size: 17px; }
.stat span { font-size: 12.5px; color: var(--texte-2); font-weight: 600; }
.stat strong { font: 800 21px var(--titres); }
.stat-alerte i { background: var(--or-pale); color: #a06a00; } .stat-alerte strong { color: #a06a00; }
.vide { padding: 40px 20px; text-align: center; color: var(--texte-2); }

/* ---------- Tableaux ---------- */
.tableau { width: 100%; border-collapse: collapse; }
.tableau th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--texte-2); background: #f8fbf9; padding: 11px 14px; border-bottom: 1px solid var(--ligne); white-space: nowrap; }
.tableau td { padding: 12px 14px; border-bottom: 1px solid #edf2ef; vertical-align: middle; }
.tableau tbody tr:hover { background: #fbfdfc; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tfoot td { padding: 10px 14px; border-top: 1px solid var(--ligne); }
.ligne-total td { font-weight: 800; font-size: 15.5px; }
.lien-fort { font-weight: 700; color: var(--encre); } .lien-fort:hover { color: var(--vert); }
.ligne-nouvelle td:first-child { box-shadow: inset 3px 0 0 var(--or); }
.cellule-resume { max-width: 340px; color: #3d4c45; }
.cellule-resume a { color: inherit; }
.actions-ligne { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.actions-ligne form { margin: 0; }
.tableau-defilant { overflow-x: auto; }
.carte-tableau { overflow-x: auto; }

.statut { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.statut-nouvelle { background: var(--or-pale); color: #8a5a00; }
.statut-confirmee { background: #e8f0ff; color: var(--bleu); }
.statut-en_cours { background: #efe8fb; color: #5e3b98; }
.statut-terminee { background: #e3f5ea; color: #0b6b45; }
.statut-annulee { background: #f2f2f2; color: #6b6b6b; }
.statut-select { border: 1px solid transparent; border-radius: 20px; padding: 5px 9px; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.statut-rapide { margin: 0; }
.statuts-rapides { display: flex; flex-wrap: wrap; gap: 8px; }
.statuts-rapides form { margin: 0; }
.statut-bouton { border: 2px solid transparent; border-radius: 20px; padding: 7px 13px; font-weight: 800; font-size: 13px; cursor: pointer; }
.statut-bouton.actif { border-color: currentColor; cursor: default; }

.onglets { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--ligne); }
.onglets a { padding: 10px 14px; color: var(--texte-2); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; text-decoration: none; }
.onglets a:hover { color: var(--vert); }
.onglets a.actif { color: var(--vert); border-bottom-color: var(--vert); }
.onglets a span { background: #e8efeb; color: var(--texte-2); font-size: 12px; border-radius: 10px; padding: 0 7px; margin-left: 3px; }
.barre-filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.barre-filtres input[type=search] { flex: 1; min-width: 220px; }
.barre-filtres input, .barre-filtres select { border: 1px solid #cfdcd4; border-radius: 10px; padding: 9px 12px; background: #fff; }

.vignette { width: 62px; height: 48px; border-radius: 9px; overflow: hidden; background: var(--vert-pale); display: grid; place-items: center; color: #9bbfad; }
.vignette img { width: 100%; height: 100%; object-fit: cover; }
.pastille-une { color: var(--or); margin-left: 5px; font-size: 12px; }
.prix-rapide { display: flex; align-items: center; gap: 5px; margin: 0; }
.prix-rapide input { width: 112px; border: 1px solid #cfdcd4; border-radius: 8px; padding: 7px 9px; }
.prix-rapide .discret { font-size: 12.5px; white-space: nowrap; }
.dispo { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: #e3f5ea; color: var(--vert); white-space: nowrap; }
.dispo-commande { background: #e8f0ff; color: var(--bleu); } .dispo-reserve { background: var(--or-pale); color: #8a5a00; }
.dispo-vendu, .dispo-loue, .dispo-indispo { background: #f2f2f2; color: #6b6b6b; }

/* ---------- Formulaires ---------- */
.formulaire-deux-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.colonne-laterale { position: sticky; top: 80px; }
.grille-champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pleine { grid-column: 1 / -1; }
.pile-champs { display: grid; gap: 13px; }
.grille-champs label, .pile-champs label { display: grid; gap: 6px; font-weight: 700; font-size: 13.5px; }
.grille-champs small, .pile-champs small { font-weight: 500; color: var(--texte-2); }
.grille-champs input, .grille-champs select, .grille-champs textarea, .pile-champs input, .pile-champs select, .champ-large, .tableau-lignes input, .tableau-lignes select {
  width: 100%; padding: 10px 12px; border: 1px solid #cfdcd4; border-radius: 9px; background: #fbfcfb; font-weight: 400; font-size: 14.5px; }
.grille-champs input:focus, .grille-champs select:focus, .grille-champs textarea:focus, .pile-champs input:focus, .pile-champs select:focus, .champ-large:focus, .tableau-lignes input:focus, .tableau-lignes select:focus { outline: none; border-color: var(--vert); background: #fff; box-shadow: 0 0 0 3px rgba(11, 107, 69, .12); }
.grille-champs input[type=file] { padding: 8px; background: #fff; }
.champ-large { margin-bottom: 10px; resize: vertical; }
.case { display: flex; align-items: center; gap: 9px; font-weight: 600; margin-top: 12px; cursor: pointer; }
.case input { width: 17px; height: 17px; accent-color: var(--vert); }
.case i { color: var(--or); }
.boutons-pile { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--ligne); }
.boutons-ligne { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.boutons-ligne form { margin: 0; }
.aide { color: var(--texte-2); font-size: 13px; margin: 10px 0 0; }
.grille-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.photo { border: 1px solid var(--ligne); border-radius: 12px; overflow: hidden; background: #fafcfa; }
.photo img { width: 100%; height: 110px; object-fit: cover; }
.photo figcaption { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; gap: 4px; flex-wrap: wrap; }
.photo.principale { border-color: var(--vert); box-shadow: 0 0 0 2px rgba(11, 107, 69, .15); }
.badge-mini { font-size: 11px; font-weight: 800; color: var(--vert); padding: 0 4px; }
.tableau-lignes td { padding: 10px 8px; vertical-align: top; }
.tableau-lignes th { padding: 10px 8px; }
.choix-offre { min-width: 260px; }
.ligne-libre { display: flex; gap: 6px; margin-top: 6px; }
.ligne-libre .champ-unite { width: 90px; flex-shrink: 0; }
.tableau-lignes .champ-qte { width: 80px; } .tableau-lignes .champ-prix { width: 130px; }
.montant-ligne { padding-top: 20px !important; font-weight: 700; }
.fiche-client > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--ligne); }
.fiche-client > div:last-child { border-bottom: 0; }
.fiche-client dt { color: var(--texte-2); }
.fiche-client dd { text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.total-commande { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; font-weight: 700; }
.total-commande strong { font: 800 21px var(--titres); color: var(--vert); }
.bloc-details { padding: 16px 20px; border-top: 1px solid var(--ligne); background: #fbfdfc; }
.bloc-details p { margin-top: 6px; color: #3d4c45; }
.zone-danger { border-color: #f4d2cc; }
.zone-danger h2 { color: var(--rouge); }
.zone-danger form { margin-top: 12px; }

/* ---------- Messages ---------- */
.liste-messages { list-style: none; }
.liste-messages li a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 20px; border-top: 1px solid #edf2ef; color: var(--encre); text-decoration: none; }
.liste-messages li a:hover { background: #fbfdfc; }
.liste-messages .apercu { grid-column: 1 / -1; color: var(--texte-2); font-size: 13.5px; }
.liste-messages .non-lu strong::before, .non-lu .lien-fort::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--or); margin-right: 7px; vertical-align: middle; }
.liste-messages .discret { font-size: 12.5px; }
.tableau-messages .non-lu td { background: #fffdf6; }
.col-case { width: 38px; }
.col-case input { width: 17px; height: 17px; accent-color: var(--vert); }
.barre-groupe { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.barre-groupe .case { margin: 0; }
.barre-groupe select { border: 1px solid #cfdcd4; border-radius: 9px; padding: 7px 10px; background: #fff; }
.badge-nouveau { font-size: 11px; font-weight: 800; background: var(--or-pale); color: #8a5a00; border-radius: 10px; padding: 1px 7px; }
.puce-fichier { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--or-pale); color: #8a5a00; margin-right: 4px; }
.puce-fichier.vocal { background: #efe8fb; color: #5e3b98; }
.message-complet { white-space: normal; line-height: 1.75; color: #2b3a33; font-size: 15px; }
.fichier-joint { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--ligne); display: grid; gap: 10px; justify-items: start; }
.fichier-joint img { max-height: 320px; border-radius: 10px; border: 1px solid var(--ligne); }
.fichier-joint audio { width: 100%; }
.lien-discret { font-size: 13px; color: var(--texte-2); }
.classement { padding-left: 20px; display: grid; gap: 8px; }
.classement li span:first-child { font-weight: 700; margin-right: 8px; }

/* ---------- Connexion ---------- */
.page-connexion { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #0f7a50, transparent 50%), linear-gradient(135deg, var(--vert-nuit), var(--vert)); }
.carte-connexion { width: min(430px, 100%); background: #fff; border-radius: 20px; padding: 34px; box-shadow: 0 25px 70px rgba(0, 0, 0, .28); }
.carte-connexion h1 { font: 800 27px var(--titres); }
.sous-titre { color: var(--texte-2); margin: 6px 0 20px; font-size: 14px; }
.formulaire-connexion { display: grid; gap: 14px; }
.formulaire-connexion label { display: grid; gap: 6px; font-weight: 700; font-size: 13.5px; }
.formulaire-connexion input { width: 100%; padding: 12px 13px; border: 1px solid #cfdcd4; border-radius: 10px; font-size: 15px; }
.formulaire-connexion input:focus { outline: none; border-color: var(--vert); box-shadow: 0 0 0 3px rgba(11, 107, 69, .12); }
.champ-mdp { position: relative; display: block; }
.champ-mdp button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--texte-2); cursor: pointer; padding: 8px; }
.formulaire-connexion .bouton { padding: 13px; margin-top: 4px; }
.retour-site { display: block; text-align: center; margin-top: 18px; font-size: 13.5px; font-weight: 600; }

/* ---------- Écrans moyens et mobiles ---------- */
@media (max-width: 1100px) {
  .deux-colonnes, .deux-colonnes-large, .formulaire-deux-colonnes { grid-template-columns: minmax(0, 1fr); }
  .colonne-laterale { position: static; }
}
@media (max-width: 860px) {
  .barre-laterale { transform: translateX(-100%); transition: transform .25s; box-shadow: 10px 0 30px rgba(0, 0, 0, .2); }
  .menu-ouvert .barre-laterale { transform: none; }
  .menu-ouvert .voile { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 45; }
  .admin-principal { margin-left: 0; }
  .bouton-menu { display: block; }
  .admin-barre { padding: 0 16px; }
  .admin-contenu { padding: 18px 14px; }
  .grille-champs { grid-template-columns: minmax(0, 1fr); }
  .titre-page h1 { font-size: 23px; }
  .tableau { min-width: 720px; }
  .tableau-lignes { min-width: 620px; }
  .liste-messages li a { padding: 12px 14px; }
}
@media print {
  .barre-laterale, .admin-barre, .admin-pied, .bouton, .zone-danger, .statuts-rapides, .titre-page .actions, form .champ-large, .carte-titre a, .boutons-ligne { display: none !important; }
  .admin-principal { margin: 0; } .admin-contenu { padding: 0; }
  .carte { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}
