/* ==========================================================================
   Lenor Macaire — système visuel commun (boutique, espace vendeur, administration)
   Mobile d'abord : les règles de base visent le téléphone, les @media élargissent.
   Coins 6px max, filets fins, pas de dégradés : l'orange est réservé aux actions.
   ========================================================================== */

@font-face { font-family: 'Outfit'; font-weight: 400; font-display: swap; src: url('../fonts/outfit/outfit-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 500; font-display: swap; src: url('../fonts/outfit/outfit-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 600; font-display: swap; src: url('../fonts/outfit/outfit-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 700; font-display: swap; src: url('../fonts/outfit/outfit-latin-700-normal.woff2') format('woff2'); }

:root {
    --lm-orange: #F2622E;
    --lm-orange-fonce: #D44F1E;
    --lm-orange-pale: #FFF3EC;
    --lm-encre: #1D1D1F;
    --lm-texte: #3A3A3C;
    --lm-gris: #6E6E73;
    --lm-gris-clair: #A1A1A6;
    --lm-filet: #E5E5EA;
    --lm-fond: #F5F5F7;
    --lm-blanc: #FFFFFF;
    --lm-vert: #1E8E3E;
    --lm-vert-pale: #E8F5EC;
    --lm-rouge: #C5221F;
    --lm-rouge-pale: #FCE8E6;
    --lm-bleu: #1A5FB4;
    --lm-bleu-pale: #E8F0FB;
    --lm-ambre: #B26A00;
    --lm-ambre-pale: #FFF4E0;
    --lm-rayon: 6px;
    --lm-entete-h: 56px;
    --lm-barre-h: 60px;
    --bs-body-font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-color: var(--lm-texte);
    --bs-body-bg: var(--lm-fond);
    --bs-border-color: var(--lm-filet);
    --bs-border-radius: var(--lm-rayon);
    --bs-link-color-rgb: 29, 29, 31;
    --bs-link-hover-color-rgb: 212, 79, 30;
}

html { -webkit-text-size-adjust: 100%; }
body { font-size: 15px; line-height: 1.5; background: var(--lm-fond); color: var(--lm-texte); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--lm-encre); font-weight: 600; letter-spacing: -0.01em; }
h1, .h1 { font-size: 1.5rem; }
h2, .h2 { font-size: 1.25rem; }
h3, .h3 { font-size: 1.1rem; }
a { text-decoration: none; }
img { max-width: 100%; }
.text-gris { color: var(--lm-gris) !important; }
.text-orange { color: var(--lm-orange) !important; }
.text-vert { color: var(--lm-vert) !important; }
.text-rouge { color: var(--lm-rouge) !important; }
.fw-600 { font-weight: 600; }
.petit { font-size: 0.85rem; }
.tres-petit { font-size: 0.75rem; }
.chiffre { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lm-conteneur { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ----------------------------------------------------------------- Logo */
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--lm-encre); flex-shrink: 0; }
.logo-marque { width: 36px; height: 36px; border-radius: 6px; background: var(--lm-orange); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 0.95rem; letter-spacing: 0.02em; }
.logo-nom { font-weight: 700; font-size: 1.05rem; line-height: 1; letter-spacing: 0.02em; }
.logo-nom small { display: block; font-weight: 400; font-size: 0.68rem; color: var(--lm-gris); letter-spacing: 0; margin-top: 2px; }

/* ----------------------------------------------------------------- Boutons */
.btn { border-radius: var(--lm-rayon); font-weight: 500; padding: 0.55rem 1rem; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn-lg { padding: 0.75rem 1.25rem; font-size: 1rem; }
.btn-orange { background: var(--lm-orange); border-color: var(--lm-orange); color: #fff; }
.btn-orange:hover, .btn-orange:focus { background: var(--lm-orange-fonce); border-color: var(--lm-orange-fonce); color: #fff; }
.btn-orange:disabled { background: var(--lm-gris-clair); border-color: var(--lm-gris-clair); }
.btn-encre { background: var(--lm-encre); border-color: var(--lm-encre); color: #fff; }
.btn-encre:hover { background: #000; color: #fff; }
.btn-contour { background: #fff; border: 1px solid var(--lm-filet); color: var(--lm-encre); }
.btn-contour:hover { border-color: var(--lm-encre); color: var(--lm-encre); background: #fff; }
.btn-contour-orange { background: #fff; border: 1px solid var(--lm-orange); color: var(--lm-orange); }
.btn-contour-orange:hover { background: var(--lm-orange); color: #fff; }
.btn-lien { background: none; border: 0; padding: 0; color: var(--lm-encre); text-decoration: underline; text-underline-offset: 3px; }
.btn-danger-doux { background: #fff; border: 1px solid #F1B6B3; color: var(--lm-rouge); }
.btn-danger-doux:hover { background: var(--lm-rouge); color: #fff; border-color: var(--lm-rouge); }
.btn-icone { width: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.lien-fleche { color: var(--lm-encre); font-weight: 500; white-space: nowrap; }
.lien-fleche::after { content: ' →'; }
.lien-fleche:hover { color: var(--lm-orange); }

/* ----------------------------------------------------------------- Formulaires */
.form-control, .form-select { border-radius: var(--lm-rayon); border-color: #D2D2D7; padding: 0.6rem 0.75rem; font-size: 15px; }
.form-control:focus, .form-select:focus { border-color: var(--lm-encre); box-shadow: 0 0 0 3px rgba(29, 29, 31, 0.08); }
.form-label { font-weight: 500; color: var(--lm-encre); margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-text { color: var(--lm-gris); }
.form-check-input:checked { background-color: var(--lm-orange); border-color: var(--lm-orange); }
.champ-requis::after { content: ' *'; color: var(--lm-rouge); }
.invalid-feedback { font-size: 0.82rem; }

/* Choix sous forme de cases (variantes, livraison, paiement) */
.choix-liste { display: flex; flex-wrap: wrap; gap: 8px; }
.choix { position: relative; }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix label { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0.4rem 0.9rem; border: 1px solid #D2D2D7; border-radius: var(--lm-rayon); background: #fff; cursor: pointer; font-weight: 500; color: var(--lm-encre); }
.choix input:checked + label { border-color: var(--lm-encre); box-shadow: inset 0 0 0 1px var(--lm-encre); }
.choix input:disabled + label { color: var(--lm-gris-clair); background: var(--lm-fond); text-decoration: line-through; cursor: not-allowed; }
.choix input:focus-visible + label { outline: 2px solid var(--lm-orange); outline-offset: 2px; }
.choix-bloc label { display: flex; width: 100%; justify-content: space-between; padding: 0.8rem 1rem; }

/* Quantité */
.quantite { display: inline-flex; align-items: stretch; border: 1px solid #D2D2D7; border-radius: var(--lm-rayon); background: #fff; }
.quantite button { width: 40px; border: 0; background: none; font-size: 1.1rem; color: var(--lm-encre); }
.quantite button:disabled { color: var(--lm-gris-clair); }
.quantite input { width: 48px; border: 0; text-align: center; font-weight: 600; -moz-appearance: textfield; }
.quantite input::-webkit-outer-spin-button, .quantite input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ----------------------------------------------------------------- Blocs */
.bloc { background: #fff; border: 1px solid var(--lm-filet); border-radius: var(--lm-rayon); }
.bloc-corps { padding: 16px; }
.bloc-tete { padding: 14px 16px; border-bottom: 1px solid var(--lm-filet); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bloc-tete h2, .bloc-tete h3 { margin: 0; font-size: 1rem; }
.bloc-pied { padding: 12px 16px; border-top: 1px solid var(--lm-filet); }
.total { color: var(--lm-gris); font-weight: 500; }
.total:not(:empty)::before { content: '('; }
.total:not(:empty)::after { content: ')'; }
.section { padding: 24px 0; }
.section-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-tete h2 { margin: 0; }
.section-tete p { margin: 2px 0 0; color: var(--lm-gris); font-size: 0.9rem; }

/* En-tête de page (espaces vendeur/admin, pages intérieures) */
.page-entete { padding: 16px 0 12px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-entete h1 { margin: 0; }
.page-entete .sous-titre { color: var(--lm-gris); margin: 2px 0 0; font-size: 0.9rem; }
.fil-ariane { font-size: 0.82rem; color: var(--lm-gris); margin-bottom: 4px; }
.fil-ariane a { color: var(--lm-gris); }
.fil-ariane a:hover { color: var(--lm-encre); }
.fil-ariane span + span::before { content: '/'; margin: 0 6px; color: var(--lm-gris-clair); }

/* Chiffres clés : libellé à gauche, nombre aligné à droite, filet entre les lignes */
.chiffres { display: grid; grid-template-columns: 1fr; column-gap: 32px; }
.chiffres .ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--lm-filet); }
.chiffres .ligne:last-child { border-bottom: 0; }
.chiffres .libelle { color: var(--lm-texte); }
.chiffres .libelle small { display: block; color: var(--lm-gris); font-size: 0.78rem; }
.chiffres .valeur { font-weight: 600; color: var(--lm-encre); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chiffres .valeur.grand { font-size: 1.2rem; }
.chiffres a.ligne:hover .libelle { color: var(--lm-orange); }

/* Chiffre vedette (une seule grande valeur en tête de bloc) */
.vedette { padding: 16px; }
.vedette .etiquette { color: var(--lm-gris); font-size: 0.85rem; }
.vedette .montant { font-size: 1.9rem; font-weight: 700; color: var(--lm-encre); line-height: 1.2; font-variant-numeric: tabular-nums; }

/* Étiquettes de statut */
.etq { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.etq::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.etq-attente { background: var(--lm-ambre-pale); color: var(--lm-ambre); }
.etq-cours { background: var(--lm-bleu-pale); color: var(--lm-bleu); }
.etq-expedie { background: #EFE8FB; color: #5B2DB0; }
.etq-ok { background: var(--lm-vert-pale); color: var(--lm-vert); }
.etq-ko { background: var(--lm-rouge-pale); color: var(--lm-rouge); }
.etq-neutre { background: var(--lm-fond); color: var(--lm-gris); }
.remise { display: inline-block; background: var(--lm-rouge); color: #fff; font-weight: 700; font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; }

/* Tableaux : lisibles sur ordinateur, en cartes empilées sur téléphone */
.tableau { width: 100%; border-collapse: collapse; }
.tableau th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--lm-gris); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--lm-encre); text-align: left; white-space: nowrap; }
.tableau td { padding: 12px; border-bottom: 1px solid var(--lm-filet); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau tbody tr:hover { background: #FAFAFA; }
@media (max-width: 767.98px) {
    .tableau-pile thead { display: none; }
    .tableau-pile, .tableau-pile tbody, .tableau-pile tr, .tableau-pile td { display: block; width: 100%; }
    .tableau-pile tr { padding: 12px 16px; border-bottom: 1px solid var(--lm-filet); }
    .tableau-pile td { padding: 3px 0; border: 0; text-align: left !important; }
    .tableau-pile td[data-libelle]::before { content: attr(data-libelle) ' : '; color: var(--lm-gris); font-size: 0.82rem; }
    .tableau-pile td.td-titre { font-weight: 600; color: var(--lm-encre); margin-bottom: 2px; }
    .tableau-pile td.td-actions { padding-top: 8px; }
}

/* Liste de lignes cliquables (commandes, notifications…) */
.liste-lignes { list-style: none; margin: 0; padding: 0; }
.liste-lignes > li { border-bottom: 1px solid var(--lm-filet); }
.liste-lignes > li:last-child { border-bottom: 0; }
.liste-lignes .ligne-lien { display: flex; gap: 12px; align-items: center; padding: 12px 16px; color: inherit; }
.liste-lignes .ligne-lien:hover { background: #FAFAFA; }
.liste-lignes .ligne-principale { flex: 1; min-width: 0; }
.liste-lignes .ligne-titre { font-weight: 600; color: var(--lm-encre); }
.liste-lignes .ligne-sous { color: var(--lm-gris); font-size: 0.85rem; }

/* État vide */
.vide { text-align: center; padding: 40px 16px; color: var(--lm-gris); }
.vide .bi { font-size: 2.2rem; color: var(--lm-gris-clair); display: block; margin-bottom: 8px; }
.vide h3 { font-size: 1.05rem; color: var(--lm-encre); }

/* Visuel neutre quand une image manque */
.visuel-vide { display: flex; align-items: center; justify-content: center; background: var(--lm-fond); color: var(--lm-gris-clair); width: 100%; height: 100%; }
.visuel-vide .bi { font-size: 2rem; }
.vignette { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; background: var(--lm-fond); flex-shrink: 0; border: 1px solid var(--lm-filet); overflow: hidden; }
.vignette.petite { width: 44px; height: 44px; }
.monogramme { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 4px; background: var(--lm-encre); color: #fff; font-weight: 600; flex-shrink: 0; }

/* Alertes et messages flash */
.alerte { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--lm-rayon); border: 1px solid; font-size: 0.92rem; }
.alerte .bi { font-size: 1.1rem; line-height: 1.3; }
.alerte-ok { background: var(--lm-vert-pale); border-color: #BFE3C9; color: #145C29; }
.alerte-ko { background: var(--lm-rouge-pale); border-color: #F4C7C3; color: #8C1A17; }
.alerte-info { background: var(--lm-bleu-pale); border-color: #C6D8F2; color: #123F78; }
.alerte-attention { background: var(--lm-ambre-pale); border-color: #F5DCAE; color: #7A4900; }

/* Notifications passagères */
.toasts { position: fixed; z-index: 1090; left: 16px; right: 16px; bottom: calc(var(--lm-barre-h) + 12px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 768px) { .toasts { left: auto; right: 24px; bottom: 24px; width: 360px; } }
.toast-lm { pointer-events: auto; background: var(--lm-encre); color: #fff; padding: 12px 14px; border-radius: var(--lm-rayon); display: flex; gap: 10px; align-items: flex-start; box-shadow: 0 6px 24px rgba(0,0,0,.18); animation: toast-entree .2s ease-out; }
.toast-lm.ko { background: var(--lm-rouge); }
.toast-lm a { color: #fff; text-decoration: underline; }
@keyframes toast-entree { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Pagination */
.pagination-lm { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 16px 0; }
.pagination-lm a, .pagination-lm span { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--lm-filet); border-radius: var(--lm-rayon); background: #fff; color: var(--lm-encre); font-weight: 500; }
.pagination-lm .actif { background: var(--lm-encre); border-color: var(--lm-encre); color: #fff; }
.pagination-lm .inactif { color: var(--lm-gris-clair); }

/* Onglets soulignés */
.onglets { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--lm-filet); scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglets a { padding: 10px 12px; white-space: nowrap; color: var(--lm-gris); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.onglets a.actif { color: var(--lm-encre); border-bottom-color: var(--lm-encre); }
.onglets a .compte { color: var(--lm-gris); font-weight: 400; margin-left: 2px; }

/* Barre de filtres */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filtres .form-control, .filtres .form-select { width: auto; min-width: 0; flex: 1 1 160px; padding: 0.45rem 0.7rem; }

/* Graphique en barres (SVG fait main) */
.graphe { width: 100%; height: 160px; }
.graphe rect { fill: var(--lm-encre); }
.graphe rect.zero { fill: var(--lm-filet); }
.graphe text { font-size: 10px; fill: var(--lm-gris); font-family: inherit; }

/* Utilitaires */
.filet { border-top: 1px solid var(--lm-filet); }
.sticky-bas { position: sticky; bottom: 0; z-index: 10; }
.coupe { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coupe-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chargement { opacity: .55; pointer-events: none; }
[x-cloak] { display: none !important; }
@media (min-width: 768px) {
    h1, .h1 { font-size: 1.75rem; }
    .chiffres.deux-colonnes { grid-template-columns: 1fr 1fr; }
    .bloc-corps { padding: 20px; }
}

/* Logo Kerzah (fichiers dans public/images/logo) */
.logo-complet { height: 30px; width: auto; display: block; }
.logo-symbole { height: 34px; width: auto; display: block; }
.menu-lateral .logo-complet { height: 24px; }
.menu-lateral .menu-tete .logo { flex-direction: column; align-items: flex-start; gap: 2px; }
.pied .logo-complet { height: 32px; }
