/* ==========================================================================
   HIDOM — Design système mobile
   Classes partagées pour les pages admin (et au-delà).
   Se charge APRÈS main.css pour pouvoir surcharger.
   Actif surtout sous @media (max-width:768px), mais classes utilisables
   aussi sur desktop pour unifier le style.
   ========================================================================== */

/* ---- Variables couleurs ---- */
:root {
    /* Hauteur de la barre de navigation mobile (pill + FAB + padding + safe-area).
       Utilisée par tous les footers collants pour ne pas passer derrière. */
    --hd-nav-offset: calc(82px + env(safe-area-inset-bottom, 0px));

    --hd-gold:       #F7A828;
    --hd-gold-soft:  rgba(247,168,40,0.92);
    --hd-gold-dim:   rgba(247,168,40,0.14);
    --hd-gold-edge:  rgba(247,205,70,0.44);
    --hd-bg:         #080808;
    --hd-surface-1:  rgba(255,255,255,0.04);
    --hd-surface-2:  rgba(255,255,255,0.07);
    --hd-border:     rgba(255,255,255,0.08);
    --hd-border-strong: rgba(255,255,255,0.14);
    --hd-text-1:     rgba(255,255,255,0.95);
    --hd-text-2:     rgba(255,255,255,0.68);
    --hd-text-3:     rgba(255,255,255,0.42);
    --hd-danger:     rgba(220,53,69,0.9);
    --hd-success:    rgba(107,214,163,0.9);
    --hd-info:       rgba(107,163,214,0.9);
}

/* ==========================================================================
   1. Page wrapper + safe-area
   ========================================================================== */
.hd-page {
    padding: 16px 16px calc(100px + env(safe-area-inset-bottom, 0px));
    max-width: 720px;
    margin: 0 auto;
}
.hd-page > * + * { margin-top: 16px; }

/* ==========================================================================
   2. Titre iOS-style (large title)
   ========================================================================== */
.hd-title-large {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--hd-text-1);
    margin: 8px 0 4px;
    line-height: 1.1;
}
.hd-title-sub {
    font-size: 13px;
    color: var(--hd-text-3);
    margin: 0 0 8px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.hd-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hd-text-3);
    margin: 24px 0 10px 4px;
}

/* ==========================================================================
   3. Sections (cartes arrondies iOS)
   ========================================================================== */
.hd-section {
    background: var(--hd-surface-1);
    border: 0.5px solid var(--hd-border);
    border-radius: 16px;
    overflow: hidden;
}
.hd-section--plain { background: transparent; border: none; }
.hd-section__header {
    padding: 14px 16px 10px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 0.5px solid var(--hd-border);
}
.hd-section__title {
    font-size: 14px; font-weight: 700; color: var(--hd-text-1);
    letter-spacing: 0.01em;
}
.hd-section__action {
    font-size: 13px; font-weight: 600; color: var(--hd-gold-soft);
    background: none; border: none; cursor: pointer; padding: 6px 8px;
    font-family: inherit;
}

/* ==========================================================================
   4. Lignes tappables (56px min, style iOS)
   ========================================================================== */
.hd-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    min-height: 56px;
    text-decoration: none; color: inherit;
    cursor: pointer;
    transition: background-color .12s, transform .12s;
    position: relative;
    background: transparent; border: none; width: 100%;
    font-family: inherit; text-align: left;
}
.hd-row + .hd-row { border-top: 0.5px solid var(--hd-border); }
.hd-row:active { background: rgba(247,168,40,0.06); transform: scale(0.997); }
.hd-row__leading {
    width: 40px; height: 40px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: var(--hd-surface-2);
    color: var(--hd-text-2);
}
.hd-row__leading svg { width: 22px; height: 22px; stroke-width: 1.8; }
.hd-row__content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hd-row__title {
    font-size: 15px; font-weight: 600; color: var(--hd-text-1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hd-row__subtitle {
    font-size: 13px; color: var(--hd-text-3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hd-row__trailing {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    color: var(--hd-text-3); font-size: 14px;
}
.hd-row__chevron { opacity: 0.4; width: 10px; height: 16px; }

/* Variantes : statut coloré à gauche */
.hd-row--status { border-left: 3px solid transparent; padding-left: 13px; }
.hd-row--status.is-signe   { border-left-color: var(--hd-success); }
.hd-row--status.is-envoye  { border-left-color: var(--hd-gold-soft); }
.hd-row--status.is-vu      { border-left-color: var(--hd-info); }
.hd-row--status.is-annule  { border-left-color: var(--hd-danger); }
.hd-row--status.is-termine { border-left-color: var(--hd-text-3); }

/* ==========================================================================
   5. Segmented control (iOS style)
   ========================================================================== */
.hd-segmented {
    display: flex; gap: 2px; padding: 3px;
    background: var(--hd-surface-1); border: 0.5px solid var(--hd-border);
    border-radius: 12px;
    position: relative;
}
.hd-segmented__item {
    flex: 1; padding: 10px 12px; text-align: center;
    font-size: 13px; font-weight: 600;
    color: var(--hd-text-2);
    border-radius: 9px; cursor: pointer;
    background: transparent; border: none; font-family: inherit;
    transition: color .15s, background .15s;
    min-height: 40px;
}
.hd-segmented__item.is-active {
    background: rgba(247,168,40,0.18);
    color: var(--hd-gold-soft);
    box-shadow: inset 0 0 0 0.5px var(--hd-gold-edge);
}
.hd-segmented__item:active:not(.is-active) {
    background: var(--hd-surface-2);
}

/* ==========================================================================
   6. Boutons (primaire / secondaire / ghost)
   ========================================================================== */
.hd-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 0 20px; min-height: 48px;
    border-radius: 12px; border: 0;
    font-size: 15px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    text-decoration: none; letter-spacing: 0.01em;
    transition: transform .12s, background .15s, box-shadow .15s;
    white-space: nowrap;
}
.hd-btn:active { transform: scale(0.97); }
.hd-btn--block { width: 100%; }
.hd-btn--lg { min-height: 56px; font-size: 16px; border-radius: 14px; padding: 0 24px; }
.hd-btn--sm { min-height: 40px; font-size: 13px; padding: 0 14px; border-radius: 10px; }

.hd-btn--primary {
    background: linear-gradient(135deg, #F7A828 0%, #FBBD40 100%);
    color: #0b0b0b;
    box-shadow: 0 6px 20px rgba(247,168,40,0.32);
}
.hd-btn--primary:hover { box-shadow: 0 8px 26px rgba(247,168,40,0.44); }

.hd-btn--secondary {
    background: var(--hd-surface-2);
    color: var(--hd-text-1);
    border: 0.5px solid var(--hd-border-strong);
}
.hd-btn--secondary:active { background: var(--hd-surface-1); }

.hd-btn--ghost {
    background: transparent;
    color: var(--hd-gold-soft);
    border: 0.5px solid var(--hd-gold-edge);
}
.hd-btn--ghost:active { background: var(--hd-gold-dim); }

.hd-btn--danger {
    background: rgba(220,53,69,0.15); color: rgba(255,110,120,0.95);
    border: 0.5px solid rgba(220,53,69,0.4);
}

/* ==========================================================================
   7. Sticky action bar (footer collant pour formulaires + modals)
   ========================================================================== */
.hd-action-bar {
    position: sticky; bottom: 0; left: 0; right: 0;
    display: flex; gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(12,12,14,0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 0.5px solid var(--hd-border);
    z-index: 20;
}
.hd-action-bar > .hd-btn { flex: 1; }

/* ==========================================================================
   8. Bottom sheet (menu d'actions secondaires)
   ========================================================================== */
.hd-sheet-backdrop {
    position: fixed; inset: 0; z-index: 1150;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
}
.hd-sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }

.hd-sheet {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1160;
    background: rgba(18,18,22,0.97);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border-top: 0.5px solid var(--hd-border-strong);
    border-radius: 20px 20px 0 0;
    padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.32,0.72,.37,1.02);
    max-height: 85vh; overflow-y: auto;
}
.hd-sheet.is-open { transform: translateY(0); }
.hd-sheet__grabber {
    width: 40px; height: 5px; border-radius: 3px;
    background: rgba(255,255,255,0.22);
    margin: 6px auto 14px;
}
.hd-sheet__title {
    font-size: 13px; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--hd-text-3);
    padding: 0 4px 12px;
}
.hd-sheet__item {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 12px;
    min-height: 56px;
    font-size: 15px; color: var(--hd-text-1); font-weight: 500;
    text-decoration: none; cursor: pointer;
    background: none; border: 0; width: 100%;
    font-family: inherit; text-align: left;
    border-radius: 12px;
    transition: background .12s;
}
.hd-sheet__item + .hd-sheet__item { margin-top: 2px; }
.hd-sheet__item:active { background: var(--hd-surface-2); }
.hd-sheet__item svg { width: 22px; height: 22px; stroke-width: 1.8; flex-shrink: 0; color: var(--hd-text-2); }
.hd-sheet__item.is-danger { color: rgba(255,110,120,0.95); }
.hd-sheet__item.is-danger svg { color: rgba(255,110,120,0.95); }
.hd-sheet__sep { height: 0.5px; background: var(--hd-border); margin: 6px 4px; }

/* ==========================================================================
   9. Swipe actions (actions cachées sous une ligne que l'on tire vers la gauche)
   ========================================================================== */
.hd-swipe {
    position: relative; overflow: hidden;
    background: var(--hd-surface-1);
}
.hd-swipe__content {
    position: relative; z-index: 2;
    background: var(--hd-bg);
    transition: transform .25s cubic-bezier(.32,0.72,.37,1.02);
    touch-action: pan-y;
}
.hd-swipe__actions {
    position: absolute; top: 0; right: 0; bottom: 0;
    display: flex; align-items: stretch;
    z-index: 1;
}
.hd-swipe__btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    width: 84px; padding: 0 6px;
    font-size: 11px; font-weight: 700; color: #fff;
    border: 0; cursor: pointer; font-family: inherit;
}
.hd-swipe__btn svg { width: 20px; height: 20px; stroke-width: 1.8; }
.hd-swipe__btn--danger  { background: #d94354; }
.hd-swipe__btn--warn    { background: #e08a35; }
.hd-swipe__btn--neutral { background: #495057; }

/* ==========================================================================
   10. Stat cards (tableau de bord)
   ========================================================================== */
.hd-stat {
    display: flex; align-items: center; gap: 14px;
    background: var(--hd-surface-1);
    border: 0.5px solid var(--hd-border);
    border-radius: 14px;
    padding: 14px 16px;
    min-height: 68px;
    text-decoration: none;
    color: inherit;
    transition: transform .12s, background .12s;
}
.hd-stat:active { transform: scale(0.98); background: var(--hd-surface-2); }
.hd-stat__icon {
    width: 40px; height: 40px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: var(--hd-surface-2);
    color: var(--hd-text-2);
}
.hd-stat__icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
.hd-stat__body { flex: 1; min-width: 0; }
.hd-stat__value {
    font-size: 22px; font-weight: 800; color: var(--hd-text-1);
    line-height: 1.1; letter-spacing: -0.01em;
}
.hd-stat__label {
    font-size: 12px; color: var(--hd-text-3); font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hd-stat--alert  { border-color: rgba(220,53,69,0.4); background: rgba(220,53,69,0.08); }
.hd-stat--alert  .hd-stat__value { color: rgba(255,140,150,0.95); }
.hd-stat--warn   { border-color: rgba(247,168,40,0.38); background: rgba(247,168,40,0.08); }
.hd-stat--warn   .hd-stat__value { color: rgba(255,200,110,0.95); }

/* ==========================================================================
   11. Badges
   ========================================================================== */
.hd-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
    border-radius: 10px; line-height: 1.4;
    background: var(--hd-surface-2); color: var(--hd-text-2);
}
.hd-badge--gold    { background: var(--hd-gold-dim); color: var(--hd-gold-soft); }
.hd-badge--success { background: rgba(107,214,163,0.14); color: var(--hd-success); }
.hd-badge--danger  { background: rgba(220,53,69,0.15); color: rgba(255,110,120,0.95); }
.hd-badge--info    { background: rgba(107,163,214,0.14); color: var(--hd-info); }
.hd-badge--dot::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
}

/* ==========================================================================
   12. Avatar (initiales colorées)
   ========================================================================== */
.hd-avatar {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: #fff;
    letter-spacing: 0.02em;
}
.hd-avatar--lg { width: 72px; height: 72px; font-size: 26px; }

/* ==========================================================================
   13. Empty state / loading
   ========================================================================== */
.hd-empty {
    text-align: center; padding: 40px 20px;
    color: var(--hd-text-3);
}
.hd-empty__icon {
    width: 56px; height: 56px; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--hd-surface-1);
    border-radius: 16px;
    color: var(--hd-text-3);
}
.hd-empty__title { font-size: 15px; font-weight: 600; color: var(--hd-text-2); margin-bottom: 4px; }
.hd-empty__sub   { font-size: 13px; color: var(--hd-text-3); }

/* ==========================================================================
   14. Inputs (formulaires)
   ========================================================================== */
.hd-field { display: flex; flex-direction: column; gap: 6px; }
.hd-field__label {
    font-size: 12px; font-weight: 600; color: var(--hd-text-3);
    letter-spacing: 0.06em; text-transform: uppercase;
    padding-left: 4px;
}
.hd-input, .hd-textarea, .hd-select {
    width: 100%;
    padding: 14px 14px;
    min-height: 52px;
    font-size: 16px; /* évite zoom iOS */
    color: var(--hd-text-1);
    background: var(--hd-surface-1);
    border: 0.5px solid var(--hd-border-strong);
    border-radius: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s, background .15s;
}
.hd-input:focus, .hd-textarea:focus, .hd-select:focus {
    border-color: var(--hd-gold-edge);
    background: rgba(247,168,40,0.06);
}
.hd-textarea { min-height: 120px; resize: vertical; line-height: 1.5; }

/* ==========================================================================
   15. FAB générique (on évite de dupliquer celui du header-app)
   ========================================================================== */
.hd-fab {
    position: fixed;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 54px; height: 54px; border-radius: 50%;
    background: linear-gradient(135deg, #F7A828 0%, #FBBD40 100%);
    box-shadow: 0 6px 22px rgba(247,168,40,0.42), 0 2px 8px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
    color: #0b0b0b; z-index: 80;
    border: 0; cursor: pointer;
    transition: transform .18s cubic-bezier(.34,1.56,.64,1);
}
.hd-fab:active { transform: scale(0.94); }
.hd-fab svg { width: 24px; height: 24px; stroke: rgba(0,0,0,0.95); stroke-width: 2.4; fill: none; stroke-linecap: round; }

/* ==========================================================================
   15b. Back-FAB : transforme tous les boutons "Retour" en FAB flottant
        bas-gauche, transparent, accessible au pouce.
   ========================================================================== */
@media (max-width: 768px) {
    :where(body:not(.fi,.gi,.gc,.pji)) .acd-back,
    :where(body:not(.fi,.gi,.gc,.pji)) .btn-back-link,
    :where(body:not(.fi,.gi,.gc,.pji)) .hds-btn-back,
    :where(body:not(.fi,.gi,.gc,.pji)) .folder-back,
    :where(body:not(.fi,.gi,.gc,.pji)) .msg-back-mobile {
        position: fixed !important;
        left: 14px !important;
        right: auto !important;
        top: auto !important;
        bottom: calc(var(--hd-nav-offset) + 10px) !important;
        width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
        background: rgba(18,18,22,0.55) !important;
        backdrop-filter: blur(16px) saturate(160%);
        -webkit-backdrop-filter: blur(16px) saturate(160%);
        border: 0.5px solid rgba(255,255,255,0.14) !important;
        border-radius: 50% !important;
        color: rgba(247,168,40,0.95) !important;
        font-size: 0 !important;       /* masque le texte "Retour" / "← Clients" */
        text-decoration: none !important;
        z-index: 85;
        box-shadow: 0 6px 20px rgba(0,0,0,0.4);
        transition: transform .18s, background .15s;
    }
    :where(body:not(.fi,.gi,.gc,.pji)) .acd-back:active,
    :where(body:not(.fi,.gi,.gc,.pji)) .btn-back-link:active,
    :where(body:not(.fi,.gi,.gc,.pji)) .hds-btn-back:active,
    :where(body:not(.fi,.gi,.gc,.pji)) .folder-back:active,
    :where(body:not(.fi,.gi,.gc,.pji)) .msg-back-mobile:active {
        transform: scale(0.92);
        background: rgba(247,168,40,0.18) !important;
    }
    /* SVG éventuel dans ces boutons */
    :where(body:not(.fi,.gi,.gc,.pji)) .acd-back svg,
    :where(body:not(.fi,.gi,.gc,.pji)) .btn-back-link svg,
    :where(body:not(.fi,.gi,.gc,.pji)) .hds-btn-back svg,
    :where(body:not(.fi,.gi,.gc,.pji)) .folder-back svg,
    :where(body:not(.fi,.gi,.gc,.pji)) .msg-back-mobile svg {
        width: 22px !important;
        height: 22px !important;
        font-size: 22px !important;
        flex-shrink: 0;
    }
    /* Fallback : si le bouton n'a pas de SVG, on ajoute un chevron via ::before */
    .acd-back::before,
    .btn-back-link::before,
    .hds-btn-back::before,
    .folder-back::before,
    .msg-back-mobile::before {
        content: '';
        display: inline-block;
        width: 11px; height: 11px;
        border-left: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        margin-right: -3px;
    }
    /* Si un vrai SVG est présent, on masque le chevron de fallback */
    .acd-back:has(svg)::before,
    .btn-back-link:has(svg)::before,
    .hds-btn-back:has(svg)::before,
    .folder-back:has(svg)::before,
    .msg-back-mobile:has(svg)::before {
        display: none;
    }
}

/* ==========================================================================
   15b-bis. Nav admin sans pill : Plus + FAB alignés côté pouce
   ========================================================================== */
.mob-nav__row--admin { justify-content: flex-end; }
/* En mode gaucher (row-reverse), flex-end pousse côté gauche — bon côté du pouce gauche */

/* ==========================================================================
   15c. Onglets principaux dans le drawer "Plus"
   ========================================================================== */
.plus-tabs {
    display: flex; flex-direction: column; gap: 4px;
    margin-bottom: 14px;
}
.plus-tab {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 14px;
    min-height: 60px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 0.5px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    font-size: 16px; font-weight: 600;
    transition: background .15s, border-color .15s, transform .12s;
    position: relative;
}
.plus-tab:active {
    background: rgba(255,255,255,0.07);
    transform: scale(0.985);
}
.plus-tab svg {
    width: 22px; height: 22px; stroke-width: 1.8;
    color: rgba(255,255,255,0.72); flex-shrink: 0;
}
.plus-tab.is-active {
    background: rgba(247,168,40,0.14);
    border-color: rgba(247,205,70,0.4);
    color: rgba(247,168,40,0.98);
}
.plus-tab.is-active svg { color: rgba(247,168,40,0.98); }
.plus-tab__badge {
    margin-left: auto;
    min-width: 22px; height: 22px; padding: 0 7px;
    background: rgba(247,168,40,0.92); color: #000;
    border-radius: 11px; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}
.plus-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 4px 4px 12px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: rgba(255,255,255,0.38);
}
.plus-divider::after {
    content: ''; flex: 1; height: 0.5px;
    background: rgba(255,255,255,0.12);
}

/* ==========================================================================
   16. Règles globales mobile — s'appliquent à toutes les pages admin
   qui n'ont pas été retravaillées individuellement.
   ========================================================================== */
@media (max-width: 768px) {
    /* Inputs globaux : pas de zoom iOS + 48px min */
    :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) input[type="text"], :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) input[type="email"], :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) input[type="tel"],
    :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) input[type="number"], :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) input[type="password"], :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) input[type="search"],
    :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) input[type="date"], :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) input[type="datetime-local"], :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) input[type="time"],
    :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) input[type="url"], :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) textarea, :where(body:not(.fi,.ci,.pi,.gi,.gc,.cmi,.cpi,.cgi,.ani,.rpi,.mcc,.fxi,.cdc,.pji,.dvi,.dvci)) select {
        font-size: 16px !important;
        min-height: 48px;
    }
    textarea { min-height: 100px; }

    /* Titres de page plus impactants */
    .page-header h1, h1.page-title {
        font-size: 26px !important; font-weight: 800 !important;
        letter-spacing: -0.02em; line-height: 1.15;
    }
    :where(body:not(.ci,.pji,.dvi,.dvci)) .page-inner { padding: 12px 16px 24px !important; }

    /* Modals génériques (modal-bg + modal) : bottom sheet plein largeur */
    :where(body:not(.fi,.ci,.gi,.gc,.ani)) .modal-bg.open,
    :where(body:not(.fi,.ci,.gi,.gc,.ani)) [id*="modal"][class*="open"] {
        align-items: flex-end !important;
    }
    :where(body:not(.fi,.ci,.ani)) .modal-bg > .modal,
    :where(body:not(.fi,.ci,.ani)) .modal-bg > div[class*="modal"]:not(.modal-bg) {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 92vh !important;
    }

    /* Boutons petits (33px, 36px, etc) → forcés à 44px min sur mobile */
    button, .btn, a.btn, input[type="submit"], input[type="button"] {
        min-height: 44px;
    }
    /* On ne touche pas aux tout-petits boutons utilitaires qui le demandent */
    button.btn-sm, .btn-xs, button[class*="-xs"], .tag, .pill {
        min-height: auto;
    }

    /* Empty states et alertes : plus aérés */
    :where(body:not(.fi,.ci,.cgi,.ani,.pji,.dvi,.dvci)) .empty-state { padding: 48px 20px !important; font-size: 14px !important; }
    :where(body:not(.fi,.ci,.cmi,.cpi,.cgi,.mcc)) .alert, :where(body:not(.fi,.ci,.cmi,.cpi,.cgi,.mcc)) .flash { border-radius: 12px !important; padding: 14px 16px !important; }

    /* Scrollbars horizontaux (filtres, tabs) cachés proprement */
    .filters-bar, .tabs-bar, [class*="scroll-x"] {
        scrollbar-width: none; -ms-overflow-style: none;
    }
    .filters-bar::-webkit-scrollbar,
    .tabs-bar::-webkit-scrollbar,
    [class*="scroll-x"]::-webkit-scrollbar { display: none; }
}
