/* ==========================================================================
   MaliPOS — Design System
   Structure: 1) Tokens/reset  2) Layout  3) Components  4) Responsive
   Responsive rules are kept LAST so cascade order always lets them win.
   ========================================================================== */

/* Transition legere entre pages (navigateurs compatibles ; sans effet ailleurs) */
@view-transition {
    navigation: auto;
}

/* ---------- 1) Tokens & reset ---------- */
:root {
    --color-primary: #0b4d26;
    --color-primary-light: #146538;
    --color-primary-dark: #083a1c;
    --color-accent: #259043;
    /* Dedie au fond de l'en-tete (texte blanc dessus) : --color-accent seul n'y passe le
       contraste AA que de justesse en pratique (~4.08:1, sous les 4.5:1 requis pour du texte
       normal - le titre en 16px/700 ne franchit pas le seuil "grand texte" de WCAG qui
       exigerait au moins ~18.7px en gras). Cette teinte reste le meme vert vif "clair"
       demande le 24 sept. 2026, juste assez assombrie pour porter du texte blanc lisible
       (~5.4:1) - audit UI/UX du 28 sept. 2026. */
    --color-header-bg: #1f7a3a;
    --color-secondary: #3d4f45;
    --color-secondary-bg: #eef1ef;
    --color-info: #0f6e66;
    --color-info-bg: #e2f4f2;
    --color-info-text: #0b5750;
    --color-info-border: #a8d8d3;
    --color-success: #16803d;
    /* #e0301f d'origine ne passait le contraste AA (texte blanc dessus) qu'a 4.55:1, une
       marge quasi nulle par rapport au seuil de 4.5:1 (WCAG 1.4.3) - meme teinte assombrie
       a ~5.4:1 pour une vraie marge de securite, quasi invisible a l'oeil. */
    --color-danger: #ca2b1c;
    --color-warning: #d9a017;
    --color-bg: #f4f7f5;
    --color-bg-subtle: #eaefec;
    --color-surface: #ffffff;
    --color-border: #dce6e0;
    --color-border-strong: #c3d2c9;
    --color-text: #1c2b22;
        --color-text-muted: #62766a;
    --color-focus-ring: rgba(37,144,67,0.18);
    --color-icon-bg-accent: #e8f5ea;
    --color-icon-bg-success: #dcf5e3;
    --color-icon-bg-warning: #fcf0d2;
       --color-icon-bg-danger: #fbe2df;
    --color-warning-bg: #fcf0d2;
    --color-warning-border: #e8be4e;
    --color-warning-text: #7a5a0a;
        --color-selected-bg: #e8f5ea;
    --color-badge-success-bg: #dcf5e3;
    --color-badge-success-text: #146538;
    --color-badge-danger-bg: #fbe2df;
    --color-badge-danger-text: #a32418;
    --color-badge-warning-bg: #fcf0d2;
    --color-badge-warning-text: #7a5a0a;
    --color-badge-info-bg: #e2f4f2;
    --color-badge-info-text: #0b5750;
    --color-badge-muted-bg: #edf2ee;
    --color-badge-muted-text: #62766a;
    --color-alert-success-bg: #dcf5e3;
    --color-alert-success-text: #146538;
    --color-alert-success-border: #8ed8a3;
    --color-alert-error-bg: #fbe2df;
    --color-alert-error-text: #a32418;
    --color-alert-error-border: #f0a79e;
    --color-alert-warning-border: #e8be4e;
    --color-alert-info-border: #a8d8d3;

    /* Police unique de toute l'application : Roboto, compacte (12 oct. 2026). */
    --font-sans: 'Roboto', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SFMono-Regular', 'Courier New', monospace;
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 13px;
    --text-md: 14px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 500;
    --fw-bold: 700;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(15,23,18,0.06);
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(15,23,18,0.12);
    /* Degrades reutilises a plusieurs endroits (pastilles de nav ET boutons d'en-tete) -
       audit UI/UX du 28 sept. 2026 : ces deux paires de couleurs etaient dupliquees en dur
       a 2 endroits chacune (.mp-nav-icon-badge--amber/--blue et .mp-header-icon-btn/
       .mp-header-store-icon), un risque de divergence si l'une des deux etait modifiee sans
       l'autre. */
    --gradient-amber: linear-gradient(145deg, #e8b545, #c4922a);
    --gradient-blue: linear-gradient(145deg, #4aa8dd, #2274a5);
    --nav-width: 230px;
    --nav-width-collapsed: 64px;
}

* { box-sizing: border-box; }

html { overscroll-behavior-y: contain; }

/* ---------- Barre de progression de navigation ---------- */
/* Retour visuel immediat au clic sur un lien/soumission de formulaire (amelioration UI/UX
   du 28 sept. 2026, demande explicite) : sur une connexion lente, l'ecran restait figE
   sans aucun signe que quelque chose se passait entre le clic et l'affichage de la page
   suivante (chargement plein document, pas une SPA). Jamais sur la caisse (voir
   initNavProgress() dans partials/nav.blade.php, qui l'exclut explicitement) - deja le
   fichier le plus fragile de l'application, et la plupart des interactions y sont des
   actions locales (ajout panier, ouverture de modale) qui ne naviguent jamais nulle part. */
.mp-nav-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: var(--color-accent); z-index: 9999;
    transition: width 0.3s ease, opacity 0.2s ease;
    opacity: 0; pointer-events: none;
}
.mp-nav-progress.active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .mp-nav-progress { transition: opacity 0.2s ease; }
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    margin: 0;
    line-height: 1.45;
    font-size: 13px;
    padding-left: var(--nav-width);
    position: relative;
    -webkit-font-smoothing: antialiased;
    transition: padding-left 0.25s ease;
    animation: mp-page-fade-in 0.18s ease-out;
    overscroll-behavior-y: contain;
}

/* Tirer pour actualiser natif du navigateur, corrige pour de vrai (24 sept. 2026,
   essai sur telephone reel) : overscroll-behavior seul sur
   body ne suffit pas sur Safari iOS - le rebond touche toute la page tant que c'est
   BODY qui defile. La vraie technique est
   que la page elle-meme ne defile JAMAIS : seul le contenu, dans son propre conteneur,
   defile. L'en-tete se retrouve alors naturellement fixe sans rien de plus.
   :has(> .mp-content) cible uniquement les pages qui suivent ce patron partage
   (nav + header + .mp-content) - la caisse (pos/index.blade.php, body.pos-page) a sa
   propre mise en page totalement independante et n'est jamais touchee, meme par accident,
   vu qu'elle n'a pas de .mp-content : c'est deja le fichier le plus fragile de
   l'application (voir plus haut), aucune raison de le risquer pour ce correctif. */
body:has(> .mp-content):not(.pos-page) {
    height: 100vh; height: 100dvh;
    display: flex; flex-direction: column; overflow: hidden;
}
body:has(> .mp-content):not(.pos-page) > .mp-header { flex-shrink: 0; position: static; }
body:has(> .mp-content):not(.pos-page) > .mp-content {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
    /* Plus de -webkit-overflow-scrolling:touch (1er nov. 2026) : sur iPad, cette zone qui defile passait AU-DESSUS du
       menu lateral ouvert (tiroir sous la page), malgre son z-index. iOS 13+ defile deja avec inertie sans elle. */
    overscroll-behavior-y: contain;
}

@keyframes mp-page-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    body { animation: none; }
}

.mp-content, .mp-nav {
    position: relative;
    z-index: 1;
}

/* ---------- 2) Layout: sidebar ---------- */
.mp-nav {
    background: var(--color-surface);
    width: var(--nav-width);
    position: fixed;
    top: 0;
    left: 0;
    /* dvh apres vh (jamais l'inverse) : sur Safari iOS, 100vh mesure la hauteur MAXIMALE
       du viewport (barre d'outils masquee), donc le bas du tiroir se retrouve sous la
       barre d'outils quand elle est affichee. 100dvh suit son etat reel - le dernier
       item (Parametres) restait invisible/inatteignable meme une fois le defilement lui-
       meme corrige (signale par l'utilisateur le 24 sept. 2026, capture a l'appui). */
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    /* PAS de -webkit-overflow-scrolling:touch ici, contrairement a .mp-content plus haut
       (meme probleme de fond corrige differemment, 24 sept. 2026) : sur Safari iOS, cette
       propriete sur un ancetre change le bloc conteneur d'un descendant position:fixed
       (le menu flottant .mp-nav-submenu, mode rail 782-1200px) - au lieu de rester relatif
       a la fenetre comme prevu, il se retrouvait positionne/coupe par rapport a .mp-nav
       lui-meme (64px de large, overflow-x:hidden), donc invisible. Deux correctifs cibles
       sur le flyout (transform:translateZ(0)) sans effet sur iPad reel, confirmant que le
       probleme vient bien d'ici. iOS 13+ fait deja defiler overflow:auto avec inertie sans
       cette propriete - elle n'apportait donc plus rien de reel, juste ce risque.
       overscroll-behavior-y suffit pour le confort de defilement restant. */
    overscroll-behavior-y: contain;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 2px 0 6px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, width 0.25s ease;
}

.mp-nav-logo {
    display: flex; align-items: center; gap: 10px; padding: env(safe-area-inset-top, 0px) 18px 0; min-height: calc(63px + env(safe-area-inset-top, 0px));
    text-decoration: none; color: var(--color-text); font-weight: 700; font-size: 16px;
    border-bottom: 1px solid var(--color-border); flex-shrink: 0; overflow: hidden;
}
.mp-nav-logo img { border-radius: 6px; flex-shrink: 0; object-fit: cover; }
.mp-nav-logo .mp-nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mp-nav-toggle {
    display: none; position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 12px; z-index: 210;
    width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
    background: var(--color-surface); color: var(--color-text); align-items: center; justify-content: center;
    cursor: pointer; box-shadow: var(--shadow);
}
.mp-nav-scrim { display: none; position: fixed; inset: 0; background: rgba(15,23,18,0.4); z-index: 99; }
.mp-nav-scrim.open { display: block; }
/* Menu ouvert : la page derriere reste immobile, le defilement du menu ne passe jamais a la page (1er nov. 2026, iPad). */
html:has(> body > .mp-content), html:has(> body > .mp-content) body { overscroll-behavior: none; }
html.mp-nav-lock, html.mp-nav-lock body { overflow: hidden; overscroll-behavior: none; }
html.mp-nav-lock body > .mp-content { overflow: hidden !important; touch-action: none; }
.mp-nav-scrim { touch-action: none; }
.mp-nav, .mp-nav-flyout { overscroll-behavior: contain; }

.mp-nav-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.mp-nav-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(145deg, var(--color-primary-light), var(--color-primary-dark));
    box-shadow: 0 3px 6px rgba(0,0,0,.25), inset 0 1px 2px rgba(255,255,255,.35), inset 0 -2px 3px rgba(0,0,0,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 600; color: #fff;
}

.mp-nav-profile-text { font-size: 12px; line-height: 1.4; overflow: hidden; }
.mp-nav-profile-role { color: var(--color-text-muted); font-size: 12px; white-space: nowrap; }
.mp-nav-profile-name { font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* flex-shrink:0 indispensable : .mp-nav est un flex column a hauteur fixe (100vh) avec
   overflow-y:auto - sans ce blocage, ouvrir un sous-menu (qui grandit via max-height)
   pousse le contenu total au-dela de 100vh, et flexbox COMPRIME tous les autres elements
   de la nav au lieu de simplement faire defiler, deformant visiblement toute la barre
   laterale a chaque ouverture (signale par l'utilisateur le 23 sept. 2026). */
.mp-nav-group { border-bottom: 1px solid var(--color-border); flex-shrink: 0; }

.mp-nav-group-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 18px; cursor: pointer; font-size: 14px; font-weight: 500;
    color: var(--color-text); user-select: none; white-space: nowrap;
    position: relative; transition: background-color 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
}
.mp-nav-group-toggle:hover { background: var(--color-bg); padding-left: 22px; }

.mp-nav-group-left { display: flex; align-items: center; gap: 12px; overflow: hidden; transition: color 0.18s ease; }
.mp-nav-chevron { transition: transform 0.25s ease; font-size: 12px; color: var(--color-text-muted); flex-shrink: 0; }
.mp-nav-group.open .mp-nav-chevron { transform: rotate(180deg); }

/* nav-current (pas .open) porte la mise en evidence : .open pilote uniquement le
   depli/repli et est retire sur mobile/tablette a chaque chargement de page par
   initNavResponsive() (pour eviter qu'un flyout ne s'ouvre tout seul en mode rail) - si
   la mise en evidence dependait de .open, la rubrique active devenait invisible dans le
   tiroir mobile des l'ouverture, sans aucun moyen de savoir ou on se trouve (signale par
   l'utilisateur le 24 sept. 2026). nav-current est ecrit une fois cote serveur (voir
   nav.blade.php) et jamais touche par le JS : il reste correct meme si l'utilisateur
   deplie une AUTRE rubrique pour la parcourir. */
.mp-nav-group.nav-current > .mp-nav-group-toggle {
    background: var(--color-icon-bg-accent); color: var(--color-accent); font-weight: 600;
}
.mp-nav-group.nav-current > .mp-nav-group-toggle::before {
    content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
    background: var(--color-accent); border-radius: 0 3px 3px 0;
}

/* Fond distinct de var(--color-surface) (utilise partout ailleurs dans la nav) : sans ca,
   un sous-menu deplie n'a pour seule difference que son indentation - trop discret, ses
   liens se lisent comme de nouvelles rubriques principales plutot que comme un groupe
   rattache a celle au-dessus (signale par l'utilisateur le 23 sept. 2026, desktop ET mobile). */
.mp-nav-submenu {
    display: flex; flex-direction: column; padding: 0; background: var(--color-bg);
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}
.mp-nav-group.open .mp-nav-submenu { max-height: 640px; opacity: 1; padding: 4px 0 8px 0; }

.mp-nav-submenu a {
    color: var(--color-text-muted); text-decoration: none; font-size: 13px;
    padding: 9px 18px 9px 48px; white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}
.mp-nav-submenu a:hover { color: var(--color-accent); background: var(--color-bg); padding-left: 52px; }
.mp-nav-submenu a.active { color: var(--color-accent); font-weight: 600; background: var(--color-icon-bg-accent); }
.mp-nav-submenu button {
    color: var(--color-text-muted); text-decoration: none; font-size: 13px;
    padding: 9px 18px 9px 48px; white-space: nowrap;
    background: none; border: none; width: 100%; text-align: left; font-family: inherit; cursor: pointer;
    display: flex; align-items: center; gap: 8px; transition: background-color 0.15s ease, color 0.15s ease;
}
.mp-nav-submenu button:hover { color: var(--color-danger); background: var(--color-bg); }

/* Icones de section en pastille coloree/relief (demande le 19 sept. 2026) : uniquement les
   icones de rubrique (Caisse, Rapports, Parametres...), jamais les chevrons/hamburger/
   deconnexion qui restent neutres - la couleur sert a distinguer les sections, pas a
   decorer chaque element cliquable. Le SVG reste blanc via currentColor (aucun changement
   necessaire dans partials/icon.blade.php), seule cette pastille lui donne son fond. Taille
   fixe 26px : tient sans probleme dans le rail reduit a 64px (.mp-nav.collapsed) comme dans
   le tiroir mobile plein largeur. */
.mp-nav-icon-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%; color: #fff; flex-shrink: 0;
    box-shadow: 0 3px 6px rgba(0,0,0,.25), inset 0 1px 2px rgba(255,255,255,.35), inset 0 -2px 3px rgba(0,0,0,.2);
}
.mp-nav-icon-badge svg { filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.mp-nav-icon-badge--red { background: linear-gradient(145deg, #e05f52, #b8291a); }
.mp-nav-icon-badge--green { background: linear-gradient(145deg, #4fc07a, #239548); }
.mp-nav-icon-badge--purple { background: linear-gradient(145deg, #b57cd6, #8e44ad); }
.mp-nav-icon-badge--blue { background: var(--gradient-blue); }
.mp-nav-icon-badge--orange { background: linear-gradient(145deg, #f0975a, #d9622a); }
.mp-nav-icon-badge--teal { background: linear-gradient(145deg, #3fc1b0, #159487); }
.mp-nav-icon-badge--amber { background: var(--gradient-amber); }
.mp-nav-icon-badge--cyan { background: linear-gradient(145deg, #4dd0e1, #0097a7); }
.mp-nav-icon-badge--deep-orange { background: linear-gradient(145deg, #ff8a65, #d84315); }
.mp-nav-icon-badge--slate { background: linear-gradient(145deg, #90a4ae, #607d8b); }
.mp-nav-icon-badge--pink { background: linear-gradient(145deg, #ec6fa8, #c2185b); }
.mp-nav-icon-badge--indigo { background: linear-gradient(145deg, #7986cb, #3949ab); }
.mp-nav-icon-badge--sky { background: linear-gradient(145deg, #64b5f6, #1976d2); }
.mp-nav-icon-badge--violet { background: linear-gradient(145deg, #9575cd, #5e35b1); }
.mp-nav-icon-badge--brown { background: linear-gradient(145deg, #a98274, #6d4c41); }
.mp-nav-icon-badge--grey { background: linear-gradient(145deg, #b0bec5, #78909c); }
.mp-nav-icon-badge--lightblue { background: linear-gradient(145deg, #4fc3f7, #0288d1); }
.mp-nav-icon-badge--coral { background: linear-gradient(145deg, #ff7b7b, #e53935); }

.mp-nav-single {
    display: flex; align-items: center; gap: 12px; flex-shrink: 0;
    padding: 13px 18px; color: var(--color-text); text-decoration: none; font-size: 14px;
    font-weight: 500; border-bottom: 1px solid var(--color-border); white-space: nowrap; overflow: hidden;
    position: relative; transition: background-color 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
}
.mp-nav-single:hover { background: var(--color-bg); padding-left: 22px; }
.mp-nav-single.active {
    background: var(--color-icon-bg-accent); color: var(--color-accent); font-weight: 600;
}
.mp-nav-single.active::before {
    content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
    background: var(--color-accent); border-radius: 0 3px 3px 0;
}

.mp-nav-spacer { margin-top: auto; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); flex-shrink: 0; }

/* ---------- Header ---------- */
/* Vert pleine largeur a toutes les tailles d'ecran (24 sept. 2026, harmonisation demandee
   explicitement : seuls mobile et tablette avaient ce traitement jusque-la, le bureau
   restait blanc). --color-header-bg (pas --color-accent) : voir sa definition dans les
   tokens, contraste AA avec le texte blanc. */
.mp-header {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
    background: var(--color-header-bg); border-bottom: none;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 24px 14px; position: sticky; top: 0; z-index: 60;
}
.mp-header-title { margin: 0; font-size: 16px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.mp-quota-badge { display: flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--color-warning-bg); border: 1px solid var(--color-warning-border); color: var(--color-warning-text); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.mp-quota-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-warning); flex-shrink: 0; }
@media (prefers-reduced-motion: no-preference) {
    @keyframes mpQuotaBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
    .mp-quota-dot { animation: mpQuotaBlink 1.4s ease-in-out infinite; }
}
.mp-header-actions { display: flex; align-items: center; gap: var(--space-3); }
.mp-header-search {
    display: flex; align-items: center; gap: 8px; background: var(--color-bg);
    border: 1px solid var(--color-border); border-radius: var(--radius-full); padding: 7px 14px;
    color: var(--color-text-muted); width: 220px;
}
.mp-header-search input { border: none; background: none; outline: none; font-size: var(--text-sm); color: var(--color-text); font-family: inherit; width: 100%; }
.mp-header-icon-btn {
    width: 34px; height: 34px; border-radius: 50%; border: none;
    background: var(--gradient-amber);
    box-shadow: 0 3px 6px rgba(0,0,0,.25), inset 0 1px 2px rgba(255,255,255,.35), inset 0 -2px 3px rgba(0,0,0,.2);
    color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.mp-header-icon-btn svg { filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.mp-header-icon-btn:hover { filter: brightness(1.08); }
.mp-notif-wrap { position: relative; }
.mp-notif-count { position: absolute; top: -2px; right: -2px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; background: var(--color-danger); color: #fff; font-size: 10px; font-weight: var(--fw-bold); display: flex; align-items: center; justify-content: center; line-height: 1; }
.mp-notif-dropdown { display: none; position: absolute; top: 42px; right: 0; width: 300px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); z-index: 200; overflow: hidden; }
.mp-notif-dropdown.open { display: block; }
.mp-notif-dropdown-header { padding: 12px 16px; font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--color-text); border-bottom: 1px solid var(--color-border); }
.mp-notif-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; text-decoration: none; color: var(--color-text); border-bottom: 1px solid var(--color-border); }
.mp-notif-item:last-child { border-bottom: none; }
.mp-notif-item:hover { background: var(--color-bg); }
.mp-notif-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--color-icon-bg-danger); color: var(--color-danger); }
.mp-notif-icon.warning { background: var(--color-icon-bg-warning); color: var(--color-warning); }
.mp-notif-icon.info { background: var(--color-icon-bg-accent); color: var(--color-accent); }
.mp-notif-text { flex: 1; min-width: 0; }
.mp-notif-label { font-size: var(--text-sm); font-weight: var(--fw-medium); }
.mp-notif-sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 1px; }
.mp-notif-empty { padding: 24px 16px; text-align: center; font-size: var(--text-sm); color: var(--color-text-muted); }
.mp-header-store {
    /* .92 (pas .8) : voir le commentaire de --color-header-bg - a .8 le texte descendait
       sous le seuil AA (~4.06:1), audit UI/UX du 28 sept. 2026. */
    display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.92); font-size: var(--text-sm);
    padding: 6px 12px; border-left: 1px solid rgba(255,255,255,.25); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px;
}
.mp-header-store-icon {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 24px; height: 24px; border-radius: 50%; color: #fff;
    background: var(--gradient-blue);
    box-shadow: 0 3px 6px rgba(0,0,0,.25), inset 0 1px 2px rgba(255,255,255,.35), inset 0 -2px 3px rgba(0,0,0,.2);
}
.mp-header-store-icon svg { filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.mp-header-avatar {
    width: 32px; height: 32px; border-radius: 50%; color: #fff;
    background: linear-gradient(145deg, var(--color-primary-light), var(--color-primary-dark));
    box-shadow: 0 3px 6px rgba(0,0,0,.25), inset 0 1px 2px rgba(255,255,255,.35), inset 0 -2px 3px rgba(0,0,0,.2);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.mp-header-avatar svg { filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }

/* ---------- 2) Layout: content ---------- */
.mp-content { padding: 24px; max-width: 1200px; }

.mp-h1 { font-size: 20px; font-weight: 500; color: var(--color-text); margin: 0 0 20px 0; }
.mp-h2 { font-size: 16px; font-weight: 500; color: var(--color-text); margin: 28px 0 12px 0; }

/* ---------- 3) Components ---------- */
.mp-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* Liste de fonctionnalites en dépliants (Parametres > Fonctionnalites) : chaque
   carte est un <details> natif (repliee par defaut, aucun JS requis pour ouvrir/
   fermer), meme convention que backup-tenant-card. Le bouton Activer/Desactiver
   dans le <summary> bascule juste la case a cocher cachee de sa carte ; c'est
   toujours le bouton "Enregistrer" du formulaire qui persiste l'etat cote serveur. */
.mp-feature-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mp-feature-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; cursor: pointer; list-style: none; }
.mp-feature-head::-webkit-details-marker { display: none; }
.mp-feature-title { font-size: 14px; font-weight: 500; color: var(--color-text); display: flex; align-items: center; gap: 8px; }
.mp-feature-title::before { content: '\25B8'; display: inline-block; font-size: 12px; color: var(--color-text-muted); transition: transform 0.15s; }
details[open] > .mp-feature-head .mp-feature-title::before { transform: rotate(90deg); }
.mp-feature-body { padding: 0 20px 18px 20px; }
.mp-feature-body p { font-size: 13px; color: var(--color-text-muted); margin: 0; }
.mp-feature-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 96px; padding: 7px 14px; border-radius: var(--radius-full); border: none; font-size: var(--text-xs); font-weight: var(--fw-semibold); font-family: inherit; cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease; white-space: nowrap; }
.mp-feature-toggle.is-off { background: var(--color-success); color: #fff; }
.mp-feature-toggle.is-off:hover { filter: brightness(1.08); }
.mp-feature-toggle.is-on { background: var(--color-border); color: var(--color-text-muted); }
.mp-feature-toggle.is-on:hover { background: var(--color-border-strong); }

.sa-top { background: var(--color-primary); padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; }
.sa-top h2 { color: #fff; margin: 0; font-size: 16px; }

.mp-table-wrap { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; margin-bottom: 20px; }
.mp-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.mp-table th { background: var(--color-bg); color: var(--color-text-muted); text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; font-weight: 500; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
.mp-table td { padding: 11px 16px; border-bottom: 1px solid var(--color-border); font-size: 13px; }
.mp-table tr:last-child td { border-bottom: none; }

/* Variante dense : tableaux de donnees a forte densite (rapports) */
.mp-table--dense th, .mp-table--dense td { padding: 3px 6px; text-align: center; font-size: 12px; line-height: 1.2; }
.mp-table--dense th:first-child, .mp-table--dense td:first-child { text-align: left; }
.mp-table tr:hover td { background: var(--color-bg); }

.mp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: var(--text-base); font-weight: var(--fw-medium); font-family: inherit; cursor: pointer; text-decoration: none; transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease; white-space: nowrap; line-height: 1.2; }
.mp-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--color-focus-ring); }
.mp-btn:disabled, .mp-btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.mp-btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.mp-btn.is-loading::after { content: ''; position: absolute; width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; animation: mp-spin 0.6s linear infinite; }
.mp-btn-outline.is-loading::after, .mp-btn-secondary.is-loading::after { border-color: rgba(28,43,34,0.25); border-top-color: var(--color-text); }
@keyframes mp-spin { to { transform: rotate(360deg); } }

.mp-btn-primary { background: var(--color-primary); color: #fff; }
.mp-btn-primary:hover { background: var(--color-primary-light); }
.mp-btn-primary:active { background: var(--color-primary-dark); }

.mp-btn-accent { background: var(--color-accent); color: #fff; }
.mp-btn-accent:hover { filter: brightness(1.08); }

.mp-btn-secondary { background: var(--color-secondary-bg); color: var(--color-secondary); }
.mp-btn-secondary:hover { background: var(--color-border); }

.mp-btn-success { background: var(--color-success); color: #fff; }
.mp-btn-success:hover { filter: brightness(1.08); }

.mp-btn-danger { background: var(--color-danger); color: #fff; }
.mp-btn-danger:hover { filter: brightness(1.08); }

.mp-btn-warning { background: var(--color-warning); color: #fff; }
.mp-btn-warning:hover { filter: brightness(1.05); }

.mp-btn-outline { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
.mp-btn-outline:hover { background: var(--color-bg-subtle); border-color: var(--color-border-strong); }

.mp-btn-sm { padding: 6px 12px; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.mp-btn-lg { padding: 12px 22px; font-size: var(--text-md); border-radius: var(--radius-md); }

.mp-badge { display: inline-block; padding: 4px 11px; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: var(--fw-semibold); white-space: nowrap; }
.mp-badge-success { background: var(--color-badge-success-bg); color: var(--color-badge-success-text); }
.mp-badge-danger { background: var(--color-badge-danger-bg); color: var(--color-badge-danger-text); }
.mp-badge-warning { background: var(--color-badge-warning-bg); color: var(--color-badge-warning-text); }
.mp-badge-muted { background: var(--color-badge-muted-bg); color: var(--color-badge-muted-text); }

.mp-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--color-text); white-space: nowrap; }
.mp-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.mp-status-dot.success { background: var(--color-success); }
.mp-status-dot.danger { background: var(--color-danger); }
.mp-status-dot.warning { background: var(--color-warning); }
.mp-status-dot.muted { background: var(--color-text-muted); }

.mp-progress { background: var(--color-bg); border-radius: var(--radius-full); height: 6px; overflow: hidden; }
.mp-progress-bar { height: 100%; border-radius: var(--radius-full); background: var(--color-accent); transition: width 0.2s ease; }
.mp-progress-bar.success { background: var(--color-success); }
.mp-progress-bar.warning { background: var(--color-warning); }
.mp-progress-bar.danger { background: var(--color-danger); }

.mp-form-group { margin-bottom: var(--space-4); }
.mp-label { display: block; margin-bottom: 6px; font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--color-text-muted); }
.mp-input, .mp-select, .mp-textarea {
    width: 100%; padding: 7px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    /* Grille compacte (15 nov. 2026) : 13 px sur ordinateur ; 16 px sur telephone et ecran tactile (regle plus bas),
       sinon Safari iOS zoome automatiquement l'ecran a chaque focus sur un champ. */
    font-size: 13px; font-family: inherit; background: var(--color-surface); color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mp-input:focus, .mp-select:focus, .mp-textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-focus-ring); }
.mp-input:disabled, .mp-select:disabled, .mp-textarea:disabled { background: var(--color-bg); color: var(--color-text-muted); cursor: not-allowed; }
.mp-input.is-error, .mp-select.is-error, .mp-textarea.is-error { border-color: var(--color-danger); }
.mp-input.is-error:focus, .mp-select.is-error:focus, .mp-textarea.is-error:focus { box-shadow: 0 0 0 3px rgba(224,48,31,0.12); }
.mp-field-error { color: var(--color-danger); font-size: var(--text-xs); margin-top: 5px; }
.mp-field-sm { width: auto; padding: 6px 10px; }

.mp-alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: var(--text-base); }
.mp-alert-success { background: var(--color-alert-success-bg); color: var(--color-alert-success-text); border:
1px solid var(--color-alert-success-border); }
.mp-alert-error { background: var(--color-alert-error-bg); color: var(--color-alert-error-text); border: 1px
solid var(--color-alert-error-border); }
.mp-alert-warning { background: var(--color-warning-bg); color: var(--color-warning-text); border: 1px solid var(--color-alert-warning-border); }

.mp-stats-row { display: flex; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.mp-stat-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; flex: 1; min-width: 180px; }
.mp-stat-value { font-size: var(--text-xl); font-weight: var(--fw-bold); color: var(--color-text); font-variant-numeric: tabular-nums; }
.mp-stat-label { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.4px; }

/* ---------- Empty states ---------- */
.mp-empty { text-align: center; padding: var(--space-12) var(--space-6); color: var(--color-text-muted); }
.mp-empty-text { font-size: var(--text-sm); max-width: 360px; margin: 0 auto; line-height: 1.5; }

/* Texte reserve aux lecteurs d'ecran : garde l'element dans l'arbre d'accessibilite (donc
   annonce) sans rien changer a l'affichage visuel - utile pour un titre de page structurel
   (h1) sur un ecran dense en informations ou l'afficher en grand n'a pas de sens visuel. */
.mp-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Lien d'evitement : invisible tant qu'il n'a pas le focus clavier (premier Tab de la
   page), pour permettre de sauter directement au contenu sans repasser par tout le menu
   de navigation a chaque page. */
.mp-skip-link {
    position: absolute; top: -100px; left: 8px; z-index: 2000;
    background: var(--color-primary); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 8px;
    text-decoration: none; font-size: 14px; font-weight: 600; transition: top 0.15s ease;
}
.mp-skip-link:focus { top: 0; }

/* ---------- Modal ---------- */
.mp-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,18,0.45); align-items: center; justify-content: center; z-index: 800; padding: var(--space-4); }
.mp-modal-overlay.open { display: flex; }
.mp-modal { background: var(--color-surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; }

@media (prefers-reduced-motion: reduce) {
    .mp-btn.is-loading::after { animation: none; }
}

/* ---------- Menu reduit en barre d icones (ordinateur) ---------- */

body.nav-collapsed { padding-left: var(--nav-width-collapsed); }
.mp-nav.collapsed { width: var(--nav-width-collapsed); }
.mp-nav.collapsed .mp-nav-label,
.mp-nav.collapsed .mp-nav-profile-text,
.mp-nav.collapsed .mp-nav-chevron { display: none; }
.mp-nav.collapsed .mp-nav-logo { justify-content: center; padding: 16px 0; }
.mp-nav.collapsed .mp-nav-profile { justify-content: center; padding: 14px 0; }
.mp-nav.collapsed .mp-nav-group-toggle { justify-content: center; padding: 13px 0; }
.mp-nav.collapsed .mp-nav-group-left { justify-content: center; }
.mp-nav.collapsed .mp-nav-single { justify-content: center; padding: 13px 0; }
.mp-nav.collapsed .mp-nav-single:hover, .mp-nav.collapsed .mp-nav-group-toggle:hover { padding-left: 0; }
.mp-nav.collapsed .mp-nav-submenu {
    display: none; position: fixed; background: var(--color-surface); min-width: 210px;
    max-height: 70vh; overflow-y: auto; padding: 6px 0; border-radius: 8px; box-shadow: var(--shadow-md); z-index: 110;
    opacity: 1;
}
.mp-nav.collapsed .mp-nav-group.open .mp-nav-submenu { display: flex; }
.mp-nav.collapsed .mp-nav-submenu a { padding: 10px 18px; }


/* ==========================================================================
   Login box — ecran de connexion centre (superadmin + boutique), etape 6 du
   29 sept. 2026 : etait copie-colle dans 6 fichiers avec seul max-width et
   text-align variant d'un ecran a l'autre, gardes ici en override local.
   ========================================================================== */
.login-box { background: var(--color-surface); padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow-md); width: 100%; max-width: 400px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.login-logo img { height: 40px; }

/* Superadmin content wrapper - meme pattern, max-width/padding varient par ecran
   (garde en override local dans chaque fichier quand different de la base). */
/* Contenu colle au menu (12 oct. 2026) : centre, il laissait une large bande vide sur grand ecran. */
.sa-content { padding: 20px 24px; max-width: 1400px; margin: 0; }
.sa-content .num { font-family: 'IBM Plex Mono', 'SFMono-Regular', monospace; font-variant-numeric: tabular-nums; }

/* Carte de rapport (.rp-*) - reports/by-item.blade.php garde un radius de 14px en
   override local, assume (voir commentaire sur place). */
.rp-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; padding: 16px; }

/* Hero proprietaire des pages Comptabilite - treasury.blade.php garde un override
   local (padding/gap plus compacts, pas de marge basse). */
.acc-owner-hero { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; box-shadow: var(--shadow); padding: 26px 28px; margin-bottom: 24px; display: flex; align-items: center; gap: 20px; }

/* Carte KPI superadmin (dashboard + monitoring) - .sa-kpis (grille conteneur) reste
   locale a chaque page car le nombre de colonnes differe (7 vs 4) ; monitoring.blade.php
   garde un override local pour .sa-kpi-value (24px au lieu de 21px). */
.sa-kpi {
    background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px;
    padding: 16px 16px 15px; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 10px;
    transition: box-shadow 0.2s, transform 0.2s;
}
.sa-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sa-kpi-icon {
    width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    background: var(--color-icon-bg-accent); color: var(--color-primary); flex-shrink: 0;
}
.sa-kpi.sa-kpi-alert .sa-kpi-icon { background: var(--color-icon-bg-danger); color: var(--color-danger); }
.sa-kpi.sa-kpi-ok .sa-kpi-icon { background: var(--color-icon-bg-success); color: var(--color-success); }
.sa-kpi .sa-kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--color-text-muted); }
.sa-kpi .sa-kpi-value { font-size: 20px; font-weight: 800; color: var(--color-text); line-height: 1.1; }
.sa-kpi.sa-kpi-alert .sa-kpi-value { color: var(--color-danger); }
.sa-kpi.sa-kpi-ok .sa-kpi-value { color: var(--color-success); }
.sa-kpi .sa-kpi-sub { font-size: 12px; color: var(--color-text-muted); }

/* ==========================================================================
   4) RESPONSIVE — always last, so these overrides win the cascade.
   ========================================================================== */

/* Tablet & below: sidebar collapses to a permanent icon-only rail */
@media (max-width: 1200px) {
    body { padding-left: var(--nav-width-collapsed); }

    .mp-nav { width: var(--nav-width-collapsed); }

        .mp-nav-label,
    .mp-nav-profile-text,
    .mp-nav-chevron { display: none; }

    .mp-nav-logo { justify-content: center; padding: 16px 0; }
    .mp-nav-profile { justify-content: center; padding: 14px 0; }
    .mp-nav-group-toggle { justify-content: center; padding: 13px 0; }
    .mp-nav-group-left { justify-content: center; }
    .mp-nav-single { justify-content: center; padding: 13px 0; }
    .mp-nav-single:hover, .mp-nav-group-toggle:hover { padding-left: 0; }

        .mp-nav-submenu {
             display: none;
        position: fixed;
        background: var(--color-surface);
        min-width: 210px;
        max-height: 70vh;
        overflow-y: auto;
        padding: 6px 0;
        border-radius: 8px;
        box-shadow: var(--shadow-md);
        z-index: 110;
    }
    .mp-nav-group.open .mp-nav-submenu { display: flex; }
    .mp-nav-submenu a { padding: 10px 18px; }

    .mp-content { padding: 18px; }
    .mp-stat-card { flex: 1 1 45%; }

    /* Meme habillage vert que le tiroir mobile (24 sept. 2026, demande explicite
       d'etendre a la tablette), sans le bouton hamburger : le rail d'icones reste deja
       visible en permanence a cette largeur (782-1200px), pas besoin d'un bouton pour
       l'ouvrir. */
    .mp-header {
        padding: calc(14px + env(safe-area-inset-top, 0px)) 24px 14px;
        background: var(--color-header-bg); border-bottom: none; color: #fff;
    }
    .mp-header-title { color: #fff; }
    .mp-header-icon-btn { background: rgba(255,255,255,.16); box-shadow: none; }
}

/* Telephone seulement (<= 782 px) : menu cache, ouvert en tiroir. Depuis le 18 oct. 2026 la tablette a la barre d icones laterale comme l ordinateur. */
@media (max-width: 782px) {
    body { padding-left: 0; }
    .mp-nav { width: min(280px, 84vw); transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .mp-nav.mobile-open { transform: translateX(0); }
    .mp-nav-toggle { display: flex; }
    .mp-nav-label, .mp-nav-profile-text, .mp-nav-chevron { display: block; }
    .mp-nav-logo { justify-content: flex-start; padding: 16px 18px; }
    .mp-nav-profile { justify-content: flex-start; padding: 14px 18px; }
    .mp-nav-group-toggle { justify-content: space-between; padding: 13px 18px; }
    .mp-nav-group-left { justify-content: flex-start; }
    .mp-nav-single { justify-content: flex-start; padding: 13px 18px; }
    /* Sans ca, le sous-menu ouvert (tiroir mobile) perd l'indentation heritee de la regle
       <=1200px (pensee pour un flyout hors-flux, pas pour un empilement inline) : ses liens
       se retrouvaient au meme niveau visuel que les rubriques principales, illisibles une
       fois deplie (signale par l'utilisateur le 23 sept. 2026). */
    .mp-nav-submenu { position: static; box-shadow: none; min-width: 0; }
    .mp-nav-submenu a, .mp-nav-submenu button { padding: 10px 18px 10px 48px; }
    .mp-nav-submenu a:hover, .mp-nav-submenu button:hover { padding-left: 52px; }

    /* En-tete mobile (demande le 24 sept. 2026) :
       barre pleine couleur avec le bouton menu integre dedans plutot qu'un bouton blanc
       flottant par-dessus - le bouton garde sa position/structure (nav.blade.php n'a pas
       besoin de changer), seul son habillage change pour se fondre dans la barre. */
    .mp-header {
        padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px 58px;
        background: var(--color-header-bg); border-bottom: none; color: #fff;
    }
    .mp-header-title { color: #fff; }
    .mp-header-search, .mp-header-store { display: none; }
    .mp-nav-toggle {
        background: transparent; border: none; box-shadow: none; color: #fff;
        top: calc(14px + env(safe-area-inset-top, 0px));
    }
    .mp-header-icon-btn { background: rgba(255,255,255,.16); box-shadow: none; }
    .mp-notif-dropdown { color: var(--color-text); }
}

/* Phone */
@media (max-width: 600px) {
    .mp-content { padding: 12px; }
    .mp-h1 { font-size: 16px; }
    .mp-stats-row { flex-direction: column; }
    .mp-stat-card { flex: 1 1 100%; }
    .mp-btn { padding: 8px 12px; font-size: 13px; }
    .mp-form-group { margin-bottom: 12px; }
    .mp-card { padding: 14px; }
    .mp-table th, .mp-table td { padding: 10px 12px; font-size: 13px; }

    .mp-header { gap: var(--space-2); }
    .mp-header-title { font-size: var(--text-lg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex-shrink: 1; }
    .mp-header-icon-btn { display: none; }
    .mp-header-avatar { width: 30px; height: 30px; font-size: 12px; }
}
.mp-filter-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }

@media (max-width: 600px) {
    /* Harmonise avec le style deja applique aux filtres de rapports (24 sept.
       2026) : icone + libelle sur une ligne, separee par un fin trait, plutot qu'un
       simple empilement de champs de formulaire classiques. */
    .mp-filter-row { flex-direction: column; align-items: stretch; gap: 0; }
    .mp-filter-row .mp-form-group { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--color-border); margin-bottom: 0; }
    .mp-filter-row .mp-form-group:first-child { padding-top: 0; }
    .mp-filter-row .mp-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
    .mp-filter-row .mp-btn { width: 100%; justify-content: center; margin-top: 12px; }
}

.rp-filter-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.rp-date-nav { display: flex; align-items: center; gap: 6px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; padding: 6px 10px; }
.rp-date-nav button { background: none; border: none; color: var(--color-text); cursor: pointer; font-size: 14px; padding: 2px 6px; }
.rp-date-nav span { font-size: 13px; color: var(--color-text); text-transform: capitalize; }
.rp-dropdown-wrap { position: relative; }
.rp-dropdown-menu { display: none; position: absolute; top: 38px; left: 0; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; box-shadow: var(--shadow-md); padding: 8px 0; z-index: 200; min-width: 220px; max-height: 300px; overflow-y: auto; }
.rp-dropdown-menu.open { display: block; }
.rp-dropdown-menu label { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.rp-dropdown-menu label:hover { background: var(--color-bg); }
.rp-filter-icon { display: inline-flex; color: var(--color-text-muted); flex-shrink: 0; }
.rp-filter-main { display: inline-flex; align-items: center; gap: 8px; }
.rp-filter-chevron { color: var(--color-text-muted); font-size: 12px; }

/* En-tete des rapports (demande le 24 sept. 2026) : sur mobile, les 3 filtres passent de pastilles en ligne a des
   lignes pleine largeur empilees avec icone + libelle + chevron, comme une vraie liste
   de reglages plutot qu'une rangee de boutons qui debordent sur petit ecran. */
@media (max-width: 782px) {
    .rp-filter-row {
        flex-direction: column; gap: 0; margin: 0 -16px 18px; flex-wrap: nowrap;
        background: var(--color-surface); border-top: 1px solid var(--color-border);
    }
    .rp-dropdown-wrap { width: 100%; }
    .rp-date-nav {
        justify-content: space-between; width: 100%; background: none; border: none;
        border-radius: 0; border-bottom: 1px solid var(--color-border); padding: 14px 16px;
    }
    .rp-date-nav button { font-size: 16px; padding: 2px 8px; }
    /* Libelle centre dans la ligne (comme "Septembre 2026" au-dessus), chevron detache
       en position absolue a droite plutot que pousse par justify-content:space-between -
       sinon le libelle colle a gauche et laisse un grand vide avant la fleche (signale
       par l'utilisateur le 24 sept. 2026, capture a l'appui). */
    .rp-filter-row .mp-btn.mp-btn-outline.mp-btn-sm {
        width: 100%; display: flex; align-items: center; justify-content: center;
        background: var(--color-surface); border: none; border-bottom: 1px solid var(--color-border);
        border-radius: 0; padding: 14px 16px; font-size: 14px; position: relative;
    }
    .rp-filter-main { font-size: 14px; }
    .rp-filter-row .mp-btn.mp-btn-outline.mp-btn-sm .rp-filter-chevron {
        position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    }
    .rp-dropdown-menu { position: fixed; left: 12px; right: 12px; top: auto; width: auto; }
}

/* ---------- Volets repliables des formulaires longs (11 oct. 2026) ----------
   L'essentiel reste visible ; les options (photo, code-barre, taxe, conditionnements...) sont dans
   des volets fermes, ouverts d'un clic (<details> natif, sans script). */
.mp-fold { border: 1px solid var(--color-border); border-radius: var(--radius-md); margin: 12px 0 0; background: var(--color-surface); }
.mp-fold > summary { list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; color: var(--color-text); }
.mp-fold > summary::-webkit-details-marker { display: none; }
.mp-fold > summary::before { content: '\203A'; font-size: 16px; line-height: 1; color: var(--color-accent); transition: transform 0.15s; }
.mp-fold[open] > summary::before { transform: rotate(90deg); }
.mp-fold > summary small { font-weight: 400; color: var(--color-text-muted); font-size: 12px; margin-left: auto; text-align: right; }
.mp-fold > .mp-fold-body { padding: 4px 14px 14px; border-top: 1px solid var(--color-border); }
.mp-fold > .mp-fold-body > .mp-form-group:first-child { margin-top: 12px; }
.mp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .mp-pair { grid-template-columns: 1fr; } }

/* Badge de formule (16 oct. 2026) : fonction visible mais reservee, en essai gratuit ou en Pro. */
.mp-plan-tag { display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.4; padding: 1px 7px; border-radius: 999px; background: #e3f0ff; color: #1d4ed8; white-space: nowrap; }
.mp-plan-tag--premium { background: #fdf0cf; color: #8a5a00; }
.mp-nav-locked { opacity: 0.6; }
.mp-nav-locked:hover { opacity: 0.9; }
.mp-nav-locked .mp-plan-tag { margin-left: auto; }

/* Ecran vide soigne (17 oct. 2026) : partials/empty-state. */
.mp-empty-state { text-align: center; padding: 36px 16px 32px; }
.mp-empty-state-icon { width: 80px; height: 80px; margin: 0 auto 14px; border-radius: 50%; background: var(--color-bg); color: var(--color-text-muted); display: flex; align-items: center; justify-content: center; }
.mp-empty-state-title { font-size: 16px; font-weight: 600; color: var(--color-text); margin-bottom: 4px; }
.mp-empty-state-text { font-size: 13px; color: var(--color-text-muted); margin: 0 auto 16px; max-width: 380px; line-height: 1.5; }
.mp-empty-state-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ==========================================================================
   Barre verte et menu (17 oct. 2026, demande de l'utilisateur) : barre fine de 48 px
   avec le bouton ☰ a gauche, le titre de la page et la cloche seulement. Sur ordinateur,
   la barre couvre toute la largeur ; le menu d'icones est dessous, et ☰ ouvre le menu
   complet PAR-DESSUS la page (la page ne bouge pas). Jamais sur la caisse (pas de menu).
   ========================================================================== */
.mp-header {
    min-height: calc(48px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 12px 0 64px;
    box-shadow: 0 1px 5px rgba(0,0,0,.3);
}
body:has(> .mp-content):not(.pos-page) > .mp-header { position: relative; z-index: 60; }
.mp-header-title { font-size: 20px; font-weight: 400; }
.mp-header-icon-btn { width: 40px; height: 40px; background: transparent; box-shadow: none; }
.mp-header-icon-btn:hover { background: rgba(255,255,255,.14); filter: none; }
.mp-nav-toggle {
    display: flex; width: 40px; height: 40px; top: calc(4px + env(safe-area-inset-top, 0px)); left: 12px;
    background: transparent; border: none; box-shadow: none; color: #fff; border-radius: 50%;
}
.mp-nav-toggle:hover { background: rgba(255,255,255,.14); }

@media (min-width: 783px) {
    body:has(> .mp-content):not(.pos-page) > .mp-header { position: relative; z-index: 150; }
    body, body.nav-collapsed { padding-left: var(--nav-width-collapsed); }
    .mp-header { margin-left: calc(-1 * var(--nav-width-collapsed)); width: calc(100% + var(--nav-width-collapsed)); box-sizing: border-box; padding-left: calc(var(--nav-width-collapsed) + 8px); }
    .mp-nav {
        top: calc(48px + env(safe-area-inset-top, 0px));
        height: calc(100vh - 48px - env(safe-area-inset-top, 0px));
        height: calc(100dvh - 48px - env(safe-area-inset-top, 0px));
    }
    .mp-nav-logo { display: none; }
    .mp-nav-scrim.open { background: transparent; }

    .mp-nav.mobile-open { width: 300px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
    .mp-nav.mobile-open .mp-nav-label,
    .mp-nav.mobile-open .mp-nav-profile-text,
    .mp-nav.mobile-open .mp-nav-chevron { display: block; }
    .mp-nav.mobile-open .mp-nav-profile { justify-content: flex-start; padding: 14px 18px; }
    .mp-nav.mobile-open .mp-nav-group-toggle { justify-content: space-between; padding: 13px 18px; }
    .mp-nav.mobile-open .mp-nav-group-left { justify-content: flex-start; }
    .mp-nav.mobile-open .mp-nav-single { justify-content: flex-start; padding: 13px 18px; }
    .mp-nav.mobile-open .mp-nav-submenu {
        display: flex; position: static; box-shadow: none; border-radius: 0; min-width: 0;
        max-height: 0; opacity: 0; padding: 0; overflow: hidden;
    }
    .mp-nav.mobile-open .mp-nav-group.open .mp-nav-submenu { max-height: 640px; opacity: 1; padding: 4px 0 8px 0; }
    .mp-nav.mobile-open .mp-nav-submenu a, .mp-nav.mobile-open .mp-nav-submenu button { padding: 9px 18px 9px 48px; }
}

/* Icones plates et PLEINES dans le menu (18 oct. 2026, demande de l utilisateur, partials/nav-icon) : plus de pastille,
   l'icone seule dans sa couleur, et plus de trait entre les rubriques (seul le compte reste separe).
   Limite au menu (.mp-nav) : la caisse reutilise les couleurs .mp-nav-icon-badge--* en pastille. */
.mp-nav .mp-nav-icon-badge { background: none; box-shadow: none; border-radius: 0; width: 24px; height: 24px; }
.mp-nav .mp-nav-icon-badge svg { filter: none; width: 24px; height: 24px; }
.mp-nav .mp-nav-icon-badge--red { color: #c0392b; }
.mp-nav .mp-nav-icon-badge--green { color: #239548; }
.mp-nav .mp-nav-icon-badge--purple { color: #8e44ad; }
.mp-nav .mp-nav-icon-badge--blue { color: #2f6fb3; }
.mp-nav .mp-nav-icon-badge--orange { color: #d9622a; }
.mp-nav .mp-nav-icon-badge--teal { color: #159487; }
.mp-nav .mp-nav-icon-badge--amber { color: #c98a00; }
.mp-nav .mp-nav-icon-badge--cyan { color: #0097a7; }
.mp-nav .mp-nav-icon-badge--deep-orange { color: #d84315; }
.mp-nav .mp-nav-icon-badge--slate { color: #607d8b; }
.mp-nav .mp-nav-icon-badge--pink { color: #c2185b; }
.mp-nav .mp-nav-icon-badge--indigo { color: #3949ab; }
.mp-nav .mp-nav-icon-badge--sky { color: #1976d2; }
.mp-nav .mp-nav-icon-badge--violet { color: #5e35b1; }
.mp-nav .mp-nav-icon-badge--brown { color: #6d4c41; }
.mp-nav .mp-nav-icon-badge--grey { color: #78909c; }
.mp-nav .mp-nav-icon-badge--lightblue { color: #0288d1; }
.mp-nav .mp-nav-icon-badge--coral { color: #e53935; }
.mp-nav .mp-nav-group, .mp-nav .mp-nav-single { border-bottom: none; }
.mp-nav > .mp-nav-group:first-of-type { border-bottom: 1px solid var(--color-border); }
.mp-nav .mp-nav-avatar { box-shadow: none; background: none; color: #757575; width: 32px; height: 32px; }

/* Fiche en cartes (18 oct. 2026) : une carte blanche par partie, avec un titre, et les boutons
   Annuler / Enregistrer en bas, toujours visibles. Les volets facultatifs deviennent aussi des cartes. */
.mp-form-cards { max-width: 620px; }
.mp-form-section { margin-bottom: 14px; }
.mp-form-section-title, .mp-form-cards .mp-fold > summary { font-size: 16px; font-weight: 500; color: var(--color-text); }
.mp-form-section-title { margin: 0 0 14px; }
.mp-form-cards .mp-fold { margin: 0 0 14px; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.mp-form-cards .mp-fold > summary { padding: 16px 18px; }
.mp-form-cards .mp-fold > .mp-fold-body { padding: 4px 18px 18px; }
.mp-form-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px;
    padding: 12px 0; background: var(--color-bg); border-top: 1px solid var(--color-border);
}
.mp-form-actions .mp-btn { min-width: 120px; justify-content: center; }
/* Petite liste a cote de l'icone quand le menu est reduit (18 oct. 2026) : collee a la barre, liens lisibles. */
.mp-nav.collapsed:not(.mobile-open) .mp-nav-submenu { border-radius: 4px; padding: 6px 0; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.mp-nav.collapsed:not(.mobile-open) .mp-nav-submenu a { color: var(--color-text); font-size: 14px; padding: 10px 20px; }
.mp-nav.collapsed:not(.mobile-open) .mp-nav-submenu a:hover { padding-left: 20px; background: var(--color-bg); }
/* Copie de la liste posee dans la page (1er nov. 2026, iPad) : l'originale reste cachee dans la barre. */
.mp-nav-group.flyout-out .mp-nav-submenu { display: none !important; }
.mp-nav-flyout {
    display: flex; flex-direction: column; position: fixed; z-index: 1000; background: var(--color-surface);
    min-width: 210px; max-height: 70vh; overflow-y: auto; padding: 6px 0; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.mp-nav-flyout a, .mp-nav-flyout button { display: block; color: var(--color-text); font-size: 14px; padding: 10px 20px; text-decoration: none; background: none; border: none; text-align: left; cursor: pointer; }
.mp-nav-flyout a:hover, .mp-nav-flyout button:hover { background: var(--color-bg); }
.mp-nav-flyout .mp-nav-label { display: inline; }
/* Meme barre en bas des fiches simples (client, fournisseur, employe, categorie, taxe...), sans la coller au bas de l'ecran. */
.mp-form-actions--inline { position: static; background: none; border-top: none; padding: 16px 0 0; }

/* Message de reussite discret (18 oct. 2026, demande de l'utilisateur) : petite bulle sombre en bas de
   l'ecran, qui disparait seule apres 4 s, au lieu du grand bandeau vert en haut de page. */
.mp-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 300; transform: translateX(-50%);
    max-width: min(560px, calc(100vw - 32px)); padding: 12px 20px; border-radius: 4px;
    background: #323232; color: #fff; font-size: 14px; line-height: 1.4; box-shadow: 0 3px 10px rgba(0,0,0,.3);
    animation: mp-toast-in .2s ease-out, mp-toast-out .3s ease-in 4s forwards; pointer-events: none;
}
@keyframes mp-toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes mp-toast-out { to { opacity: 0; visibility: hidden; transform: translate(-50%, 12px); } }
@media (prefers-reduced-motion: reduce) { .mp-toast { animation: mp-toast-out .01s linear 4s forwards; } }
/* Barre d'icones : elle defile encore sur un petit ecran, mais sans barre de defilement visible (18 oct. 2026). */
.mp-nav.collapsed:not(.mobile-open) { scrollbar-width: none; }
.mp-nav.collapsed:not(.mobile-open)::-webkit-scrollbar { display: none; }

/* Menu plus compact (18 oct. 2026, demande de l'utilisateur : « trop grand ») : lignes moins hautes
   dans le menu ouvert (ordinateur, tablette et telephone) et dans la barre d'icones. */
.mp-nav.mobile-open .mp-nav-group-toggle, .mp-nav.mobile-open .mp-nav-single { padding: 8px 16px; font-size: 13px; gap: 14px; }
.mp-nav.mobile-open .mp-nav-group-left { gap: 14px; }
.mp-nav.mobile-open .mp-nav-profile { padding: 10px 16px; }
.mp-nav.mobile-open .mp-nav-submenu a, .mp-nav.mobile-open .mp-nav-submenu button { padding: 6px 16px 6px 54px; font-size: 13px; }
.mp-nav.mobile-open .mp-nav-group.open .mp-nav-submenu { padding: 2px 0 6px; }
.mp-nav.mobile-open .mp-nav-icon-badge svg { width: 22px; height: 22px; }
.mp-nav.collapsed:not(.mobile-open) .mp-nav-group-toggle, .mp-nav.collapsed:not(.mobile-open) .mp-nav-single { padding: 10px 0; }
.mp-nav.collapsed:not(.mobile-open) .mp-nav-profile { padding: 10px 0; }

/* ==========================================================================
   Listes en une carte (.pv-*, 18 oct. 2026) : partagees par articles, clients, fournisseurs,
   categories, employes. Boutons et filtres en haut, tableau, pages en bas ; on coche des lignes
   puis « Supprimer » en haut (public/js/list-page.js) ; bas de page : partials/list-pager.
   ========================================================================== */
.pv-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.pv-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px 12px; }
.pv-actions { display: flex; align-items: center; gap: 18px; min-height: 38px; }
.pv-actions[hidden] { display: none; }
.pv-text-btn { background: none; border: none; padding: 6px 0; font: inherit; font-size: 13px; font-weight: 600; text-transform: uppercase; color: var(--color-text); text-decoration: none; cursor: pointer; }
.pv-text-btn:hover { color: var(--color-accent); }
.pv-text-btn--danger { color: var(--color-danger); }
.pv-text-btn--danger:hover { color: var(--color-danger); text-decoration: underline; }
.pv-bulk-count { font-size: 13px; color: var(--color-text-muted); }
.pv-filters { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.pv-filter { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--color-text-muted); }
.pv-filter .mp-select { min-width: 150px; border-width: 0 0 1px; border-radius: 0; background-color: transparent; padding-left: 0; }
.pv-search { display: flex; align-items: center; gap: 4px; }
.pv-search input { display: none; width: 200px; }
.pv-search.open input { display: block; }
.pv-icon-btn { background: none; border: none; color: var(--color-text-muted); cursor: pointer; padding: 6px; border-radius: 50%; display: flex; }
.pv-icon-btn:hover { background: var(--color-bg); color: var(--color-text); }
.pv-table-wrap { box-shadow: none; border: none; border-radius: 0; border-top: 1px solid var(--color-border); }
.pv-table .pv-num { text-align: right; }
.pv-row { cursor: pointer; }
.pv-name { color: var(--color-text); font-weight: 500; text-decoration: none; }
.pv-row:hover .pv-name { color: var(--color-accent); }
.pv-footer { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--color-border); font-size: 13px; color: var(--color-text-muted); }
.pv-pager { display: flex; border: 1px solid var(--color-border); border-radius: 4px; overflow: hidden; }
.pv-page-btn { width: 36px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--color-text); text-decoration: none; }
.pv-page-btn + .pv-page-btn { border-left: 1px solid var(--color-border); }
.pv-page-btn:hover { background: var(--color-bg); }
.pv-page-btn.disabled { color: var(--color-border); pointer-events: none; }
.pv-page-input { display: flex; align-items: center; gap: 6px; }
.pv-page-input input { width: 56px; text-align: center; }
@media (max-width: 782px) { .pv-filters { margin-left: 0; } .pv-filter .mp-select { min-width: 120px; } }
.pv-card--narrow { max-width: 640px; }
.pv-cell-main { display: flex; align-items: center; gap: 14px; }
.pv-avatar { width: 36px; height: 36px; border-radius: 50%; background: #e0e0e0; flex-shrink: 0; object-fit: cover; }
.pv-sub { font-size: 12px; color: var(--color-text-muted); margin-top: 1px; }
.pv-table td, .pv-table th { white-space: nowrap; }
.pv-table td.pv-wrap { white-space: normal; }

/* Barre de defilement au bord droit de l'ecran, sur toutes les pages (18 oct. 2026, demande de l'utilisateur) :
   la zone qui defile prend toute la largeur. Depuis le 8 nov. 2026 (demande de l'utilisateur), le contenu aussi :
   plus de limite a 1200 px. La caisse n'a pas de .mp-content. */
body:has(> .mp-content):not(.pos-page):not(.table-order-page) > .mp-content { max-width: none; padding-right: 24px; }
@media (max-width: 1200px) { body:has(> .mp-content):not(.pos-page):not(.table-order-page) > .mp-content { padding-right: 18px; } }
@media (max-width: 782px) { body:has(> .mp-content):not(.pos-page):not(.table-order-page) > .mp-content { padding-right: 12px; } }

/* Fiche d'une vente (pos/show, 23 oct. 2026) : une colonne de cartes, total et actions en haut. */
.sv-wrap { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.sv-back { color: var(--color-accent); text-decoration: none; font-size: 14px; font-weight: 500; }
.sv-card { margin: 0; padding: 20px 22px; }
.sv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--color-border); }
.sv-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
.sv-total { font-size: 24px; font-weight: 700; color: var(--color-text); margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.sv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sv-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 24px; margin: 16px 0 6px; }
.sv-facts dt { font-size: 12px; color: var(--color-text-muted); margin-bottom: 2px; }
.sv-facts dd { margin: 0; font-size: 14px; font-weight: 500; color: var(--color-text); }
.sv-facts .sv-due { color: var(--color-danger); font-weight: 700; }
.sv-title { font-size: 14px; font-weight: 700; margin: 18px 0 8px; color: var(--color-text); }
.sv-card > .sv-title:first-child { margin-top: 0; }
.sv-items { display: flex; flex-direction: column; }
.sv-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.sv-item:last-child { border-bottom: none; }
.sv-item-name { font-size: 14px; font-weight: 500; color: var(--color-text); }
.sv-item-qty { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.sv-item-total { font-size: 14px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sv-sums { margin-top: 6px; padding-top: 10px; border-top: 2px solid var(--color-border); display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--color-text-muted); }
.sv-sums > div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.sv-sums .sv-sum-total { font-size: 16px; font-weight: 700; color: var(--color-text); }
.sv-pay-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.sv-pay-form .mp-form-group { flex: 1 1 260px; margin: 0; }
@media (max-width: 600px) { .sv-card { padding: 16px; } .sv-total { font-size: 24px; } .sv-actions { width: 100%; } .sv-actions .mp-btn { flex: 1; justify-content: center; } }

/* Onglets d'une page regroupee (Retours, Fermetures de caisse, Ajustements des stocks, Rapports, Tresorerie...) :
   une seule entree de menu, ses pages en onglets (20 puis 30 oct. 2026). */
.rt-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin: 0 0 16px; overflow-x: auto; }
.rt-tabs a { padding: 10px 16px; font-size: 14px; color: var(--color-text-muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.rt-tabs a:hover { color: var(--color-text); }
.rt-tabs a.active { color: var(--color-text); font-weight: 600; border-bottom-color: var(--color-success); }
.rt-tabs-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 9px; background: var(--color-danger); color: #fff; font-size: 12px; text-align: center; }

/* Module Entrepot (31 oct. 2026) : chiffres en haut des pages de l'entrepot, ventes en gros. */
.wh-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.wh-kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--color-surface); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,.12); color: var(--color-text); text-decoration: none; }
.wh-kpi span { font-size: 12px; color: var(--color-text-muted); }
.wh-kpi b { font-size: 16px; font-weight: 600; }
a.wh-kpi:hover { box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.wh-warn { color: var(--color-danger); font-size: 12px; }
.wh-table input, .wh-table select { width: 100%; min-width: 70px; }
.wh-total-row td { font-weight: 600; }
/* Onglets du module Entrepot (31 oct. 2026, demande de l'utilisateur) : jamais de barre de defilement, les onglets
   passent a la ligne et restent compacts. */
.rt-tabs.wh-tabs { flex-wrap: wrap; overflow: visible; gap: 0 2px; }
/* Toute la largeur de la page (31 oct. 2026) : les onglets se partagent la ligne. */
.rt-tabs.wh-tabs a { flex: 1 1 auto; text-align: center; padding: 8px 10px; font-size: 13px; }
.wh-full .pv-card, .wh-full .mp-card, .wh-full .sa-form, .wh-full .wg-form { max-width: none !important; }
/* Module Entrepot (31 oct. 2026, demande de l'utilisateur) : donnees centrees ; la 1re colonne (nom) reste a gauche. */
.wh-full .pv-table th, .wh-full .pv-table td { text-align: center !important; }
.wh-full .pv-table th:first-child, .wh-full .pv-table td:first-child { text-align: left !important; }
.wh-full .wh-kpi { align-items: center; text-align: center; justify-content: center; }
.wh-full .wh-filter { justify-content: center; }
/* Textes longs (motif, article, revendeur) a gauche : centres, ils se lisent mal. */
.wh-full .pv-table th.wh-text, .wh-full .pv-table td.wh-text { text-align: left !important; }
.wh-full .pv-toolbar { align-items: center; }
.wh-full .pv-filters { align-items: flex-end; }
/* Module Entrepot (31 oct. 2026) : la barre Annuler / Enregistrer reste a la fin du formulaire, elle ne couvre plus les champs. */
.wh-full .mp-form-actions { position: static; border-top: none; }

/* Ticket de caisse (5 nov. 2026) : public/js/ticket.js ; 280 px, lisible sur une imprimante thermique. */
.tk { width: 100%; max-width: 288px; margin: 0 auto; color: #111; font-family: Roboto, Arial, sans-serif; font-size: 12px; line-height: 1.35; text-align: left; }
.tk-head { text-align: center; padding-bottom: 8px; border-bottom: 1px dashed #333; }
.tk-logo { display: block; max-height: 56px; max-width: 150px; margin: 0 auto 4px; }
.tk-name { font-size: 16px; font-weight: 700; text-transform: uppercase; }
.tk-info { padding: 6px 0; border-bottom: 1px dashed #333; }
.tk-info div { display: flex; justify-content: space-between; gap: 8px; }
.tk-lines { width: 100%; border-collapse: collapse; margin: 6px 0; table-layout: fixed; }
.tk-lines th { background: #111; color: #fff; font-size: 11px; font-weight: 700; padding: 4px; text-align: right; }
.tk-lines th:first-child { width: 40%; text-align: left; border-radius: 4px 0 0 4px; }
.tk-lines th:nth-child(2) { width: 14%; }
.tk-lines th:last-child { border-radius: 0 4px 4px 0; }
.tk-lines td { padding: 2px 4px; text-align: right; vertical-align: top; }
.tk-lines td:first-child { text-align: left; overflow-wrap: anywhere; }
.tk-sums { border-top: 1px dashed #333; padding-top: 5px; }
.tk-sums div { display: flex; justify-content: space-between; }
.tk-strong { font-size: 14px; font-weight: 700; }
.tk-total { display: flex; justify-content: space-between; background: #0E2A47; color: #fff; border-radius: 6px; padding: 6px 10px; margin: 6px 0; font-size: 18px; font-weight: 700; }
.tk-pay { text-align: center; }
.tk-due { margin: 6px auto 0; border: 2px solid #C62828; color: #C62828; border-radius: 6px; padding: 3px 8px; text-align: center; font-size: 14px; font-weight: 700; }
.tk-thanks { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #333; text-align: center; font-size: 15px; font-weight: 700; color: #0E2A47; }
.tk-note { text-align: center; font-size: 10.5px; color: #444; }
.tk-barcode { display: block; width: 100%; height: 40px; margin-top: 8px; }
.tk * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* Recherche de la barre verte (7 nov. 2026) : pages du menu, reglages et aide (partials/menu-search). */
.mp-menu-search { position: relative; margin-left: auto; width: 300px; max-width: 42vw; flex-shrink: 1; }
.mp-menu-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.85); display: flex; pointer-events: none; }
.mp-menu-search input { width: 100%; height: 34px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; padding: 0 12px 0 34px; font: inherit; font-size: 13px; outline: none; }
.mp-menu-search input::placeholder { color: rgba(255,255,255,.8); }
.mp-menu-search input:focus { background: #fff; color: var(--color-text); border-color: #fff; }
.mp-menu-search input:focus::placeholder { color: var(--color-text-muted); }
.mp-menu-search:focus-within .mp-menu-search-icon { color: var(--color-text-muted); }
.mp-menu-search-results { display: none; position: absolute; top: 40px; left: 0; right: 0; min-width: 280px; max-height: 70vh; overflow-y: auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); z-index: 210; padding: 4px 0; }
.mp-menu-search.open .mp-menu-search-results { display: block; }
.mp-menu-search-title { padding: 8px 14px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); }
.mp-menu-search-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 14px; text-decoration: none; color: var(--color-text); }
.mp-menu-search-item.current, .mp-menu-search-item:hover { background: var(--color-icon-bg-accent); }
.mp-menu-search-label { font-size: 14px; font-weight: 500; }
.mp-menu-search-group { font-size: 12px; color: var(--color-text-muted); }
.mp-menu-search-empty { padding: 12px 14px; font-size: 13px; color: var(--color-text-muted); }
@media (max-width: 782px) {
    .mp-menu-search { width: 170px; }
    .mp-menu-search-results { position: fixed; top: 56px; left: 8px; right: 8px; min-width: 0; }
}

/* Toute la largeur de l'ecran (8 nov. 2026, demande de l'utilisateur) : sur un grand ecran, listes et tableaux prennent
   toute la place ; les formulaires s'elargissent (1100 px au plus, champs courts sur 3 colonnes). Les petites pages d'une
   seule case (ouvrir la caisse, connexion) et le texte de l'aide gardent leur largeur : une ligne trop longue se lit mal. */
@media (min-width: 1400px) {
    /* Listes, tableaux et blocs d'information : toute la largeur. */
    .mp-content .pv-card[style*="max-width"]:not(.pv-card--narrow), .mp-content .mp-table-wrap[style*="max-width"],
    .mp-content .dev-table-wrap, .mp-content .dev-pairing, .mp-content .dev-download,
    .mp-content .ses-wrap, .mp-content .perm-wrap, .mp-content .bill-grid, .mp-content .bill-receipts, .mp-content .support-columns,
    .mp-content div[style*="max-width:900px"]:not(.mp-card), .mp-content div[style*="max-width:780px"]:not(.mp-card),
    .mp-content div[style*="max-width:1100px"] { max-width: none !important; }
    /* Formulaires : plus larges (1100 px au plus), sauf les petites pages d'une seule case (moins de 500 px). */
    .mp-content .mp-card[style*="max-width"]:not([style*="max-width:4"]):not([style*="max-width: 4"]),
    .mp-content form[style*="max-width"]:not([style*="max-width:4"]):not([style*="max-width: 4"]),
    .mp-content .pv-card--narrow, .mp-content .mp-form-cards, .mp-content .st-form, .mp-content .sa-form, .mp-content .sv-wrap,
    .mp-content .op-form, .mp-content .wg-form, .mp-content .ib-form, .mp-content .mp-fc-section { max-width: 1100px !important; }
    body > .mp-content { max-width: none !important; }
    .mp-content .mp-field-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Tableaux (8 nov. 2026, demande de l'utilisateur : « les donnees ne sont pas centrees, ca fait amateur ») : la premiere
   colonne (le nom) a gauche, toutes les autres centrees, comme le module Entrepot ; une case a cocher en premiere colonne
   laisse le nom a gauche. Les tableaux de saisie (lignes d'un document) gardent leur alignement. Une colonne de texte long
   peut garder la gauche avec la classe wh-text. */
/* :where() : le centrage pese peu, les regles « a gauche » ci-dessous l'emportent toujours. */
.mp-content :where(.mp-table:not(.op-rows, .ib-rows, .inv-lines, .sa-table, .st-table)) :where(th, td) { text-align: center !important; vertical-align: middle; }
.mp-content .mp-table th:first-child, .mp-content .mp-table td:first-child,
.mp-content .mp-table th:first-child:has(input[type=checkbox]) + th, .mp-content .mp-table td:first-child:has(input[type=checkbox]) + td,
.mp-content .mp-table th.wh-text, .mp-content .mp-table td.wh-text { text-align: left !important; }
.mp-content .mp-table th:first-child:has(input[type=checkbox]), .mp-content .mp-table td:first-child:has(input[type=checkbox]) { text-align: center !important; }

/* Sur grand ecran, une liste de 4 colonnes ou moins (roles, moyens de paiement, taxes, categories...) n'a pas besoin de toute
   la largeur : 960 px, sinon ses colonnes s'eloignent trop les unes des autres. */
@media (min-width: 1400px) {
    .mp-content .pv-card.pv-card.pv-card.pv-card:not(:has(th:nth-child(5))),
    .mp-content .mp-table-wrap.mp-table-wrap.mp-table-wrap.mp-table-wrap:not(:has(th:nth-child(5))):not(.pv-table-wrap) { max-width: 960px !important; }
}

/* Une seule largeur de page (8 nov. 2026, demandes de l'utilisateur : « des pages n'ont pas besoin de toute la largeur »,
   puis « ne centre pas, colle au menu lateral ») : sur grand ecran, toutes les pages du back-office tiennent dans la meme
   colonne de 1320 px, collee au menu ; chaque page commence et finit au meme endroit. En dessous de 1400 px, la page prend
   la largeur de l'ecran. */
@media (min-width: 1400px) {
    body:has(> .mp-content):not(.pos-page):not(.table-order-page) > .mp-content {
        padding-left: 24px !important;
        padding-right: max(24px, calc(100% - 1344px)) !important;
    }
}

/* Revue de design (8 nov. 2026, points 1 a 5) : un seul langage pour les boutons, les liens de retour, les titres de carte
   et les liens, dans tout le back-office. */
/* 1. Boutons : plus de bouton « texte en majuscules » ; un seul vert pour les actions principales. */
.mp-content .pv-text-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--color-border-strong, #cfd8dc);
    border-radius: var(--radius-sm); background: var(--color-surface); font-size: 13px; font-weight: 500; text-transform: none; color: var(--color-text); line-height: 1.2; }
.mp-content .pv-text-btn:hover { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-surface); }
.mp-content .pv-text-btn--danger { color: var(--color-danger); border-color: var(--color-danger); }
.mp-content .pv-text-btn--danger:hover { color: #fff; background: var(--color-danger); border-color: var(--color-danger); text-decoration: none; }
.mp-btn-success { background: var(--color-primary); color: #fff; }
/* 2. Lien de retour : le meme partout, en haut a gauche de la page. */
.mp-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 0; color: var(--color-accent); font-size: 14px; font-weight: 500; text-decoration: none; }
.mp-back:hover { text-decoration: underline; }
/* 3. Titres de carte : une seule taille et une seule graisse. */
.mp-content .mp-h2, .mp-content .sf-title, .mp-content .sv-title, .mp-content .bill-card-title, .mp-content .mp-form-section-title,
.mp-content .mp-fc-section-title { font-size: 16px; font-weight: 600; color: var(--color-text); letter-spacing: 0; }
/* 4. Liens dans le texte : la couleur de l'application (plus de bleu souligne du navigateur). */
.mp-content a:not([class]) { color: var(--color-accent); text-decoration: none; font-weight: 500; }
.mp-content a:not([class]):hover { text-decoration: underline; }

/* Revue de design, point 9 (8 nov. 2026) : sur telephone, tout ce qui se touche fait au moins 40 px de haut (boutons,
   cases, listes, pages, recherche, cloche). */
@media (max-width: 782px) {
    .mp-content .mp-btn, .mp-content .mp-btn-sm, .mp-content .pv-text-btn, .mp-content .pv-page-btn,
    .mp-content input.mp-input, .mp-content select, .mp-content .mp-select, .mp-content textarea { min-height: 40px; }
    .mp-content .mp-btn-sm { padding-top: 8px; padding-bottom: 8px; }
    .mp-menu-search input { height: 40px; }
    .mp-header-icon-btn { width: 40px; height: 40px; }
    .mp-content .mp-back { min-height: 40px; }
    .mp-content .pv-page-btn { min-width: 40px; }
    .rp-date-nav button { min-width: 40px; min-height: 40px; }
    .mp-content input[type=checkbox], .mp-content input[type=radio] { width: 22px; height: 22px; }
}

/* Filtres sur une seule ligne (8 nov. 2026, demande de l'utilisateur : « met sur la meme ligne pour reduire les espaces des
   entetes ») : l'etiquette (Du, Au, Categorie, Etat...) a gauche de sa case, plus au-dessus, dans toutes les barres de filtres. */
.pv-filters { align-items: center; }
.pv-filter { flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; }
.pv-filter > span { white-space: nowrap; }
.mp-filter-row { align-items: center; }
.mp-filter-row > .mp-form-group, .pv-filters > .mp-form-group { display: flex; flex-direction: row; align-items: center; gap: 8px; margin-bottom: 0; }
.mp-filter-row > .mp-form-group > .mp-label, .pv-filters > .mp-form-group > .mp-label { margin: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 782px) {
    .mp-filter-row > .mp-form-group, .pv-filters > .mp-form-group { padding: 6px 0; border-bottom: none; }
    .mp-filter-row > .mp-form-group > .mp-input { flex: 1; }
}
.mp-content > .mp-back, .mp-content > div > .mp-back:first-child { margin-bottom: 14px; }
/* Meme regle pour tout formulaire de filtre (methode GET), quelle que soit sa classe (ex. Comptabilite > Vue d'ensemble). */
.mp-content form[method="GET"] > .mp-form-group, .mp-content form[method="get"] > .mp-form-group { display: flex; flex-direction: row; align-items: center; gap: 8px; margin-bottom: 0; }
.mp-content form[method="GET"] > .mp-form-group > .mp-label, .mp-content form[method="get"] > .mp-form-group > .mp-label { margin: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.mp-content form[method="GET"]:has(> .mp-form-group), .mp-content form[method="get"]:has(> .mp-form-group) { align-items: center; }
/* Revue de design, point 4 (8 nov. 2026) : sur telephone, un lien dans un tableau (numero, ticket, telephone) se touche
   facilement : zone de 40 px de haut sans changer la mise en page. */
@media (max-width: 782px) {
    .mp-content .mp-table td a:not(.mp-btn):not(.pv-text-btn) { display: inline-block; padding: 10px 2px; margin: -10px 0; }
}
/* Telephone : une ligne de tableau ne se coupe pas en morceaux (date, numero sur 4 lignes) ; le tableau defile sur le cote. */
@media (max-width: 782px) {
    .mp-content .mp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .mp-content .mp-table th, .mp-content .mp-table td { white-space: nowrap; }
}

/* Pastille de formule (15 nov. 2026, demande de l'utilisateur : differencier Pro et Premium, aussi dans le superadmin). */
.mp-plan-pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; line-height: 1.5; padding: 0 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.mp-plan-pill--pro { background: #e8f5ec; color: #0b4d26; border-color: #cfe6d7; }
.mp-plan-pill--premium { background: #fdf6e3; color: #7a5410; border-color: #ead7a6; }
.mp-plan-pill--autre { background: #f1f3f2; color: #5b6660; border-color: #dde3df; }

/* Grille de texte compacte (15 nov. 2026, demande de l'utilisateur : « trouve tout et corrige ») : a l'ecran, seulement
   12, 13, 14, 16, 20 et 24 px (texte de base 13 px ; AppTypeScaleTest). Emails, PDF, tickets, etiquettes et caisse gardent
   leurs tailles. Sur telephone et ecran tactile, les cases restent a 16 px (Safari iOS zoome sous ce seuil). */
@media (max-width: 782px), (pointer: coarse) {
    .mp-input, .mp-select, .mp-textarea { font-size: 16px; }
}
