/* ============================================================
 * css_admin.css
 *
 * Interface admin (/nimda/*) — login, dashboard, recherche annonces, journal de recettes. Chargé UNIQUEMENT sur les pages admin
 * ============================================================ */

/* ===========================================================================
   /nimda — Interface admin (login + dashboard + recherche)
   =========================================================================== */

/* Body dédié pour l'admin (background sobre) */
.mh-admin-body {
    background: #f3f4f6;
    color: #1f2937;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

/* === Login === */
.mh-admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0e5b95 100%);
}
.mh-admin-login-card {
    background: #fff;
    padding: 38px 36px 32px;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: 100%;
    max-width: 400px;
}
.mh-admin-login-card header { text-align: center; margin-bottom: 22px; }
.mh-admin-login-card h1 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #1f2937;
}
.mh-admin-login-card header p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}
.mh-admin-login-card label {
    display: block;
    margin: 14px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.mh-admin-login-card input[type=text],
.mh-admin-login-card input[type=password] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.mh-admin-login-card input:focus {
    outline: none;
    border-color: #0e5b95;
    box-shadow: 0 0 0 3px rgba(14,91,149,.15);
}
.mh-admin-login-card button {
    width: 100%;
    margin-top: 22px;
    padding: 12px;
    background: linear-gradient(135deg, #0e5b95, #1e3a5f);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s;
}
.mh-admin-login-card button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(14,91,149,.35);
}
.mh-admin-login-foot {
    text-align: center;
    margin-top: 18px;
    font-size: 12px;
}
.mh-admin-login-foot a { color: #6b7280; text-decoration: none; }
.mh-admin-login-foot a:hover { color: #0e5b95; }
.mh-admin-alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}
.mh-admin-alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 3px solid #dc2626;
}

/* === Topbar admin === */
.mh-admin-topbar {
    background: linear-gradient(135deg, #1e3a5f, #0e5b95);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    position: sticky;
    top: 0;
    z-index: 100;
}
.mh-admin-topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 26px;
    height: 56px;
}
.mh-admin-brand {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .04em;
}
.mh-admin-site-link {
    color: rgba(255,255,255,.78);
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    transition: background .12s, color .12s, border-color .12s;
}
.mh-admin-site-link:hover {
    background: rgba(255,255,255,.18);
    color: #fff;
    border-color: rgba(255,255,255,.5);
}
.mh-admin-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}
.mh-admin-nav-link {
    color: rgba(255,255,255,.78);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: background .12s, color .12s;
}
.mh-admin-nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.mh-admin-nav-link.is-active {
    color: #fff;
    background: rgba(255,255,255,.18);
}
.mh-admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mh-admin-user-chip {
    background: rgba(255,255,255,.15);
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 12.5px;
    font-weight: 600;
}
.mh-admin-logout {
    color: #fff;
    text-decoration: none;
    padding: 6px 13px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    transition: background .12s, border-color .12s;
}
.mh-admin-logout:hover { background: rgba(255,255,255,.18); border-color: #fff; }

/* === Dashboard / Recherche : wrapper === */
.mh-admin-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 22px 48px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.mh-admin-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    padding: 22px 26px;
}
.mh-admin-section h2 {
    margin: 0 0 16px;
    font-size: 17px;
    color: #1f2937;
    font-weight: 700;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
}

/* === Tiles compteurs === */
.mh-admin-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}
.mh-admin-tile {
    background: linear-gradient(135deg, #f9fafb, #fff);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 18px;
    text-align: center;
    transition: transform .12s, box-shadow .15s;
}
.mh-admin-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.mh-admin-tile-v {
    font-size: 24px;
    font-weight: 700;
    color: #0e5b95;
    line-height: 1.1;
}
.mh-admin-tile-l {
    font-size: 11.5px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: 4px;
}
.mh-admin-tile-alert {
    background: linear-gradient(135deg, #fff5f5, #ffe5e5);
    border-color: #f87171;
}
.mh-admin-tile-alert .mh-admin-tile-v { color: #dc2626; }

/* Tuile "à traiter" (orange — moins critique que rouge) */
.mh-admin-tile-warn {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #f59e0b;
}
.mh-admin-tile-warn .mh-admin-tile-v { color: #b45309; }

/* Tuile cliquable (curseur + animation) */
.mh-admin-tile-clickable {
    cursor: pointer;
    position: relative;
}
.mh-admin-tile-clickable:hover {
    border-color: #0e5b95;
    box-shadow: 0 6px 18px rgba(14,91,149,.18);
}
.mh-admin-tile-warn.mh-admin-tile-clickable:hover {
    border-color: #d97706;
    box-shadow: 0 6px 18px rgba(217,119,6,.25);
}

/* Sous-libellé sous la tuile (split actifs/inactifs, etc.) */
.mh-admin-tile-sub {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    font-weight: 500;
}
.mh-admin-tile-warn .mh-admin-tile-sub { color: #92400e; }

/* Call-to-action en bas de tuile cliquable */
.mh-admin-tile-cta {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed currentColor;
    font-size: 11px;
    font-weight: 600;
    color: #0e5b95;
    opacity: .85;
    text-transform: none;
    letter-spacing: 0;
}
.mh-admin-tile-warn .mh-admin-tile-cta { color: #b45309; border-top-color: #fbbf24; }
.mh-admin-tile-clickable:hover .mh-admin-tile-cta { opacity: 1; }

/* === Panels dépliables (factures attente / demandes récentes) === */
.mh-admin-panel {
    margin-top: 18px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.05);
    overflow: hidden;
    animation: mh-admin-panel-in .2s ease-out;
}
.mh-admin-panel[hidden] { display: none; }
@keyframes mh-admin-panel-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mh-admin-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.mh-admin-panel-head h3 {
    margin: 0;
    font-size: 14px;
    color: #1f2937;
    font-weight: 700;
}
.mh-admin-panel-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mh-admin-panel-close {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 10px;
    border-radius: 6px;
}
.mh-admin-panel-close:hover { background: rgba(0,0,0,.08); color: #1f2937; }

/* Variante compacte du tableau admin pour les panels */
.mh-admin-table-compact {
    font-size: 12.5px;
}
.mh-admin-table-compact th,
.mh-admin-table-compact td {
    padding: 7px 10px;
}

/* === Grilles 2 colonnes (charge serveur + BDD) === */
.mh-admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}
.mh-admin-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 18px;
}
.mh-admin-box h3 {
    margin: 0 0 12px;
    font-size: 13px;
    color: #0e5b95;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.mh-admin-note {
    margin: 6px 0 0;
    font-size: 12px;
    color: #6b7280;
}

/* Load average barres */
.mh-admin-load-row {
    display: grid;
    grid-template-columns: 60px 1fr 50px;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
}
.mh-admin-load-label { color: #6b7280; }
.mh-admin-load-val { text-align: right; font-weight: 700; }
.mh-admin-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
}
.mh-admin-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .3s;
}
.mh-admin-bar-ok       { background: linear-gradient(90deg, #10b981, #34d399); }
.mh-admin-bar-warn     { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.mh-admin-bar-critical { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* Tables clé/valeur */
.mh-admin-kv {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.mh-admin-kv td {
    padding: 5px 0;
    border-bottom: 1px solid #e5e7eb;
}
.mh-admin-kv td:first-child {
    color: #6b7280;
    width: 45%;
}
.mh-admin-kv td:last-child {
    text-align: right;
    color: #1f2937;
    font-weight: 600;
    font-family: 'SF Mono', Menlo, Monaco, monospace;
    font-size: 12px;
}
.mh-admin-kv tr:last-child td { border-bottom: none; }

/* Tables data principales */
.mh-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.mh-admin-table th,
.mh-admin-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}
.mh-admin-table th {
    background: #f9fafb;
    font-size: 11.5px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 700;
}
.mh-admin-table tbody tr:hover { background: #f9fafb; }
.mh-admin-table-link { color: #0e5b95; text-decoration: none; }
.mh-admin-table-link:hover { text-decoration: underline; }
.mh-admin-row-off { opacity: .55; }

.mh-admin-table-mini {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.mh-admin-table-mini th,
.mh-admin-table-mini td {
    padding: 5px 8px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}
.mh-admin-table-mini th { color: #6b7280; font-size: 11px; text-transform: uppercase; }
.mh-admin-table-mini td:nth-child(2),
.mh-admin-table-mini td:nth-child(3) {
    text-align: right;
    font-family: 'SF Mono', Menlo, Monaco, monospace;
}

/* Pills d'état */
.mh-admin-pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: #e5e7eb;
    color: #6b7280;
}
.mh-admin-pill-ok   { background: #d1fae5; color: #065f46; }
.mh-admin-pill-warn { background: #fef3c7; color: #92400e; }
.mh-admin-pill-off  { background: #fee2e2; color: #991b1b; }

.mh-admin-btn-mini {
    background: #0e5b95;
    color: #fff;
    border: none;
    padding: 5px 11px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, transform .1s;
}
.mh-admin-btn-mini:hover {
    background: #1e3a5f;
    transform: translateY(-1px);
}

/* === Formulaire de recherche === */
.mh-admin-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}
.mh-admin-search-form input[type=text] {
    flex: 1;
    padding: 11px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}
.mh-admin-search-form input:focus {
    outline: none;
    border-color: #0e5b95;
    box-shadow: 0 0 0 3px rgba(14,91,149,.15);
}
.mh-admin-search-form button {
    padding: 11px 22px;
    background: #0e5b95;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.mh-admin-search-form button:hover { background: #1e3a5f; }
.mh-admin-search-form button.mh-admin-search-reset {
    background: transparent;
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
}
.mh-admin-search-form button.mh-admin-search-reset:hover {
    background: transparent;
    color: #dc2626;
}
.mh-admin-search-spinner {
    font-size: 18px;
    line-height: 1;
    animation: mh-admin-spin 1.2s linear infinite;
    user-select: none;
}
@keyframes mh-admin-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.mh-admin-search-hint {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
    margin: 0 0 16px;
}


/* === Aperçu de message + flag spam dans la table des demandes admin === */
.mh-admin-msg-cell {
    max-width: 320px;
}
.mh-admin-msg-preview {
    display: block;
    color: #4b5563;
    font-style: italic;
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    cursor: help;
}
.mh-admin-spam-flag {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-right: 6px;
    cursor: help;
}
.mh-admin-row-spam {
    background: rgba(254,226,226,.35);
}
.mh-admin-row-spam:hover {
    background: rgba(254,226,226,.55) !important;
}

/* Lien externe (icône ↗) à côté du nom dans le tableau */
.mh-admin-extlink {
    color: #0e5b95;
    text-decoration: none;
    font-size: 13px;
    margin-left: 4px;
    padding: 1px 5px;
    border-radius: 4px;
    transition: background .12s;
}
.mh-admin-extlink:hover {
    background: #e3f2fd;
    text-decoration: none;
}

/* Cellule actions (groupe de boutons) */
.mh-admin-actions-cell {
    white-space: nowrap;
}
.mh-admin-actions-cell .mh-admin-btn-mini {
    margin: 0 2px;
}

/* Bouton danger (rouge) */
.mh-admin-btn-danger {
    background: #dc2626 !important;
}
.mh-admin-btn-danger:hover {
    background: #991b1b !important;
}

/* Ligne dépliable factures */
.mh-admin-invoices-row { background: #f9fafb; }
.mh-admin-invoices-row[hidden] { display: none; }
.mh-admin-invoices-wrap {
    padding: 14px 18px;
    border-left: 3px solid #0e5b95;
    background: #fff;
    margin: 4px 0;
    border-radius: 6px;
}
.mh-admin-invoices-wrap > strong {
    display: block;
    color: #0e5b95;
    font-size: 13px;
    margin-bottom: 8px;
}

/* === Modal de suppression === */
.mh-admin-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.mh-admin-modal[hidden] { display: none; }
.mh-admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
}
.mh-admin-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0,0,0,.4);
    overflow: hidden;
}
.mh-admin-modal-head {
    padding: 16px 22px;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mh-admin-modal-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    border: none;
    padding: 0;
}
.mh-admin-modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
}
.mh-admin-modal-close:hover { background: rgba(255,255,255,.2); }
.mh-admin-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
    font-size: 13.5px;
}
.mh-admin-modal-body h3 {
    margin: 16px 0 8px;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.mh-admin-modal-body h3:first-of-type { margin-top: 0; }
.mh-admin-modal-foot {
    padding: 14px 22px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.mh-admin-modal-foot .mh-admin-btn-mini {
    padding: 9px 16px;
    font-size: 13px;
}

.mh-admin-del-warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 6px;
    color: #78350f;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}
.mh-admin-del-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.mh-admin-del-table th,
.mh-admin-del-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}
.mh-admin-del-table th {
    background: #f3f4f6;
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
}
.mh-admin-del-table td:last-child { text-align: right; white-space: nowrap; }
.mh-admin-del-table tfoot th {
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
}
.mh-admin-del-table code {
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #6b7280;
}

/* Bloc vert : données comptables PRÉSERVÉES (jamais supprimées) */
.mh-admin-del-preserved {
    margin-top: 16px;
    padding: 12px 16px;
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    border-radius: 6px;
    color: #065f46;
    font-size: 12.5px;
    line-height: 1.5;
}
.mh-admin-del-preserved strong { color: #047857; }
.mh-admin-del-preserved .mh-admin-del-table {
    margin-top: 8px;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}
.mh-admin-del-preserved .mh-admin-del-table th {
    background: #d1fae5;
    color: #065f46;
}
.mh-admin-del-preserved .mh-admin-del-table td { color: #065f46; }
.mh-admin-del-preserved .mh-admin-del-note {
    margin: 6px 0 0;
    font-size: 11.5px;
    color: #047857;
    font-style: italic;
}

.mh-admin-del-confirm {
    margin-top: 18px;
    padding: 14px 16px;
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    border-radius: 6px;
}
.mh-admin-del-confirm label {
    display: block;
    font-size: 13px;
    color: #991b1b;
    margin-bottom: 6px;
    font-weight: 600;
}
.mh-admin-del-confirm input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #dc2626;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
    background: #fff;
}
.mh-admin-del-confirm input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220,38,38,.2);
}

/* ===========================================================================
   /nimda/recettes — Journal de recettes
   =========================================================================== */

/* Header section avec bouton export */
.mh-rec-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.mh-rec-export-btn {
    background: #10b981;
    color: #fff;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(16,185,129,.25);
    transition: background .12s, transform .1s;
}
.mh-rec-export-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Presets de période (chips cliquables) */
.mh-rec-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f3f4f6;
}
.mh-rec-preset {
    padding: 7px 14px;
    background: #f3f4f6;
    color: #374151;
    border-radius: 16px;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    transition: background .12s, color .12s;
}
.mh-rec-preset:hover { background: #e5e7eb; color: #0e5b95; }
.mh-rec-preset.is-active {
    background: #0e5b95;
    color: #fff;
}

/* Filtres avancés */
.mh-rec-filters { margin: 0; }
.mh-rec-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.mh-rec-filter-row > div { display: flex; flex-direction: column; min-width: 120px; flex: 1; }
.mh-rec-filter-row label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 4px;
}
.mh-rec-filter-row input,
.mh-rec-filter-row select {
    padding: 8px 11px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    box-sizing: border-box;
}
.mh-rec-filter-row input:focus,
.mh-rec-filter-row select:focus {
    outline: none;
    border-color: #0e5b95;
    box-shadow: 0 0 0 3px rgba(14,91,149,.15);
}
.mh-rec-btn-apply {
    padding: 9px 22px;
    background: #0e5b95;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.mh-rec-btn-apply:hover { background: #1e3a5f; }

/* === KPI tiles === */
.mh-rec-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.mh-rec-kpi {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
}
.mh-rec-kpi-primary {
    background: linear-gradient(135deg, #0e5b95, #1e3a5f);
    border-color: #0e5b95;
    color: #fff;
}
.mh-rec-kpi-primary .mh-rec-kpi-label,
.mh-rec-kpi-primary .mh-rec-kpi-sub { color: rgba(255,255,255,.85); }
.mh-rec-kpi-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 700;
    margin-bottom: 6px;
}
.mh-rec-kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.mh-rec-kpi-primary .mh-rec-kpi-value { color: #fff; }
.mh-rec-kpi-positive { color: #059669; }
.mh-rec-kpi-negative { color: #dc2626; }
.mh-rec-kpi-sub {
    font-size: 11.5px;
    color: #6b7280;
    margin-top: 3px;
}
.mh-rec-kpi-delta {
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.mh-rec-delta-up    { background: rgba(16,185,129,.22); color: #d1fae5; }
.mh-rec-delta-down  { background: rgba(220,38,38,.22);  color: #fecaca; }
.mh-rec-delta-flat  { background: rgba(255,255,255,.18); color: rgba(255,255,255,.85); }
.mh-rec-kpi-delta-sub {
    font-weight: normal;
    font-size: 10.5px;
    opacity: .85;
    margin-left: 4px;
}
.mh-rec-kpi-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}
.mh-rec-kpi-list li {
    padding: 3px 0;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.mh-rec-kpi-list li strong { color: #0e5b95; min-width: 35px; }

/* === Chart mensuel (HTML/CSS, sans dépendance) === */
.mh-rec-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 220px;
    padding: 12px 12px 0;
    background: #f9fafb;
    border-radius: 8px;
    overflow-x: auto;
}
.mh-rec-bar-wrap {
    flex: 1 0 auto;
    min-width: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.mh-rec-bar-stack {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    background: rgba(229,231,235,.4);
    position: relative;
    cursor: help;
    transition: opacity .12s;
}
.mh-rec-bar-stack:hover { opacity: .85; }
.mh-rec-bar-factures {
    background: linear-gradient(to top, #0e5b95, #3b82f6);
    transition: height .25s;
}
.mh-rec-bar-avoirs {
    background: linear-gradient(to top, #991b1b, #dc2626);
    transition: height .25s;
}
.mh-rec-bar-factures-bg { background: linear-gradient(to right, #0e5b95, #3b82f6); }
.mh-rec-bar-avoirs-bg   { background: linear-gradient(to right, #991b1b, #dc2626); }
.mh-rec-bar-label {
    margin-top: 6px;
    font-size: 10.5px;
    color: #6b7280;
    text-align: center;
    text-transform: lowercase;
    white-space: nowrap;
}
.mh-rec-bar-val {
    font-size: 9.5px;
    color: #1f2937;
    font-weight: 700;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.mh-rec-legend {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
    font-size: 12px;
    color: #6b7280;
}
.mh-rec-legend-sw {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
}

/* === Tableau du journal === */
.mh-rec-table {
    font-variant-numeric: tabular-nums;
}
.mh-rec-table th a {
    color: #6b7280;
    text-decoration: none;
}
.mh-rec-table th a:hover { color: #0e5b95; }
.mh-rec-row.is-avoir {
    background: rgba(254,226,226,.4);
}
.mh-rec-row.is-avoir:hover {
    background: rgba(254,226,226,.7) !important;
}
.mh-rec-type-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.mh-rec-type-facture { background: #d1fae5; color: #065f46; }
.mh-rec-type-avoir   { background: #fee2e2; color: #991b1b; }
.mh-rec-produits {
    color: #4b5563;
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 280px;
}
.mh-rec-montant {
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}
.mh-rec-montant-pos { color: #059669; }
.mh-rec-montant-neg { color: #dc2626; }
.mh-rec-table tfoot td {
    background: #f9fafb;
    border-top: 2px solid #e5e7eb;
    padding: 12px;
}

/* Pagination */
.mh-rec-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f3f4f6;
}
.mh-rec-page-link {
    padding: 8px 16px;
    background: #f3f4f6;
    color: #0e5b95;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background .12s;
}
.mh-rec-page-link:hover { background: #0e5b95; color: #fff; }
.mh-rec-page-info {
    color: #6b7280;
    font-size: 13px;
}

/* === Responsive === */
@media (max-width: 900px) {
    .mh-admin-wrap { padding: 16px 12px 36px; }
    .mh-admin-section { padding: 16px 14px; }
    .mh-admin-topbar-inner { padding: 0 14px; gap: 14px; height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
    .mh-admin-nav { width: 100%; order: 3; overflow-x: auto; }
    .mh-admin-grid-2 { grid-template-columns: 1fr; }
    .mh-admin-table { font-size: 12px; }
    .mh-admin-table th, .mh-admin-table td { padding: 6px 8px; }
    .mh-admin-actions-cell { white-space: normal; }
    .mh-admin-actions-cell .mh-admin-btn-mini { display: block; margin: 2px 0; width: 100%; }
    .mh-rec-filter-row > div { flex: 1 1 calc(50% - 6px); min-width: 0; }
    .mh-rec-kpis { grid-template-columns: 1fr 1fr; }
    .mh-rec-kpi-value { font-size: 18px; }
    .mh-rec-chart { height: 180px; }
}
@media (max-width: 550px) {
    .mh-rec-kpis { grid-template-columns: 1fr; }
    .mh-rec-filter-row > div { flex: 1 1 100%; }
}

/* ===========================================================================
   Tuile cliquable variante <a> (lien direct vers une page)
   =========================================================================== */
.mh-admin-tile-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
    transition: transform .12s, box-shadow .15s, border-color .12s;
}
.mh-admin-tile-link:hover {
    transform: translateY(-2px);
    border-color: #0e5b95;
    box-shadow: 0 6px 18px rgba(14,91,149,.18);
    color: inherit;
}

/* ===========================================================================
   Page purge de photos (/<admin>/purge-photos)
   =========================================================================== */
.mh-purge-intro {
    background: #f9fafb;
    border-left: 3px solid #0e5b95;
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 22px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #374151;
}
.mh-purge-intro p { margin: 0 0 8px; }
.mh-purge-intro p:last-child { margin: 0; }
.mh-purge-intro code {
    background: #e5e7eb;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: #4b5563;
}
.mh-purge-warn {
    background: #fff5d6;
    border-left: 4px solid #f59e0b !important;
    color: #78350f;
    border-radius: 6px;
    padding: 10px 14px !important;
    margin-top: 12px !important;
}

/* Steps numérotées */
.mh-purge-step {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 16px;
}
.mh-purge-step-danger {
    border-color: #dc2626;
    background: linear-gradient(180deg, #fff, #fff5f5);
}
.mh-purge-step-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.mh-purge-step-head h3 {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
    font-weight: 700;
}
.mh-purge-step-danger .mh-purge-step-head h3 { color: #991b1b; }
.mh-purge-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0e5b95;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.mh-purge-step-danger .mh-purge-step-num { background: #dc2626; }

/* Formulaire de paramétrage */
.mh-purge-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 14px;
    color: #1f2937;
}
.mh-purge-input-row label {
    font-weight: 600;
    white-space: nowrap;
}
.mh-purge-input-row input[type=number] {
    width: 100px;
    padding: 9px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.mh-purge-input-row input[type=number]:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}
.mh-purge-input-row input:focus {
    outline: none;
    border-color: #0e5b95;
    box-shadow: 0 0 0 3px rgba(14,91,149,.15);
}
.mh-purge-checkbox-inline {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500 !important;
    color: #6b7280;
    cursor: pointer;
    margin-left: 8px;
}
.mh-purge-checkbox-inline input[type=checkbox] { cursor: pointer; }
.mh-purge-hint {
    font-size: 12.5px;
    color: #6b7280;
    margin: 4px 0 16px;
    line-height: 1.5;
}
.mh-purge-hint em { color: #0e5b95; font-style: normal; font-weight: 600; }

.mh-purge-actions { margin-top: 8px; }
.mh-purge-btn-preview {
    background: #0e5b95;
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s, transform .1s;
}
.mh-purge-btn-preview:hover {
    background: #1e3a5f;
    transform: translateY(-1px);
}
.mh-purge-btn-preview:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
}

/* Encarts du résultat preview */
.mh-purge-warn-box {
    background: #fef3c7;
    color: #78350f;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    border-left: 3px solid #f59e0b;
    font-size: 13px;
}
.mh-purge-empty {
    background: #d1fae5;
    color: #065f46;
    padding: 16px 18px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

/* Zone de confirmation finale */
.mh-purge-confirm p {
    margin: 0 0 12px;
    font-size: 13.5px;
    color: #991b1b;
    line-height: 1.5;
}
.mh-purge-confirm p code {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .04em;
}
.mh-purge-confirm input[type=text] {
    width: 100%;
    max-width: 320px;
    padding: 11px 14px;
    border: 2px solid #dc2626;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    letter-spacing: .05em;
    box-sizing: border-box;
    margin-bottom: 12px;
    background: #fff;
}
.mh-purge-confirm input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220,38,38,.2);
}
.mh-purge-btn-execute {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s, transform .1s, box-shadow .15s;
    display: block;
    box-shadow: 0 4px 12px rgba(220,38,38,.25);
}
.mh-purge-btn-execute:hover:not(:disabled) {
    background: #991b1b;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220,38,38,.4);
}
.mh-purge-btn-execute:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===========================================================================
   Bouton "Voir les photos" + modal de prévisualisation visuelle
   =========================================================================== */
.mh-purge-btn-photos {
    background: #fff;
    color: #0e5b95;
    border: 1.5px solid #0e5b95;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s, color .12s, transform .1s;
}
.mh-purge-btn-photos:hover {
    background: #0e5b95;
    color: #fff;
    transform: translateY(-1px);
}

/* Modal box plus large pour héberger la grille */
.mh-purge-photos-box {
    max-width: 1100px !important;
}

/* Grille de vignettes : auto-fit pour s'adapter à la largeur */
.mh-purge-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.mh-purge-photo {
    background: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    transition: transform .12s, box-shadow .15s;
    display: flex;
    flex-direction: column;
}
.mh-purge-photo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,.12);
}
.mh-purge-photo-img-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    background: #e5e7eb url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='1.5'><rect x='3' y='3' width='18' height='18' rx='2'/><circle cx='8.5' cy='8.5' r='1.5'/><polyline points='21,15 16,10 5,21'/></svg>") center/30% no-repeat;
    overflow: hidden;
    position: relative;
}
.mh-purge-photo-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mh-purge-photo-img-wrap.is-missing::after {
    content: "Image introuvable";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, calc(-50% + 24px));
    font-size: 10px;
    color: #9ca3af;
    text-align: center;
}
.mh-purge-photo-meta {
    padding: 6px 8px;
    font-size: 11px;
    line-height: 1.3;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 32px;
}
.mh-purge-photo-aid {
    font-weight: 700;
    color: #0e5b95;
    font-size: 11px;
}
.mh-purge-photo-cap {
    color: #6b7280;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
}

/* Liste dépliable des fichiers physiques concernés par photo */
.mh-purge-photo-files {
    margin-top: 4px;
    font-size: 10px;
}
.mh-purge-photo-files summary {
    cursor: pointer;
    color: #0e5b95;
    font-weight: 600;
    list-style: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background .1s;
}
.mh-purge-photo-files summary::before { content: '▸ '; }
.mh-purge-photo-files[open] summary::before { content: '▾ '; }
.mh-purge-photo-files summary:hover { background: #e3f2fd; }
.mh-purge-photo-files ul {
    list-style: none;
    padding: 4px 0 2px;
    margin: 0;
    border-top: 1px dashed #e5e7eb;
    margin-top: 4px;
}
.mh-purge-photo-files li {
    padding: 1px 0;
    font-family: 'SF Mono', Menlo, Monaco, monospace;
    font-size: 9.5px;
    color: #4b5563;
    word-break: break-all;
    line-height: 1.35;
}
.mh-purge-photo-files li.is-webp { color: #059669; }
.mh-purge-photo-files li::before { content: '· '; color: #9ca3af; }
.mh-purge-photos-more {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    margin: 14px 0 0;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 13px;
}

@media (max-width: 600px) {
    .mh-purge-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 6px;
    }
    .mh-purge-photo-meta { font-size: 10px; padding: 4px 6px; min-height: 28px; }
}

/* ============================================================
   /nimda/ipn — Journal IPN
   ============================================================ */
.mh-ipn-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}
.mh-ipn-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #6b7280;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
}
.mh-ipn-stat-cb   { border-left-color: #0e5b95; }
.mh-ipn-stat-pp   { border-left-color: #002e7f; }
.mh-ipn-stat-warn { border-left-color: #c53030; background: #fef2f2; }
.mh-ipn-stat-label { font-size: 12px; color: #6b7280; font-weight: 600; }
.mh-ipn-stat-val   { font-size: 22px; color: #1f2937; font-weight: 700; line-height: 1.2; margin-top: 2px; }
.mh-ipn-stat-val small { font-size: 12px; color: #6b7280; font-weight: 500; margin-left: 6px; }

.mh-ipn-filters {
    background: #f9fafb;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 14px;
    margin: 0 0 16px;
}
.mh-ipn-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: flex-end;
}
.mh-ipn-filter-row label {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: #4b5563;
    font-weight: 600;
}
.mh-ipn-filter-row input[type="date"],
.mh-ipn-filter-row input[type="number"],
.mh-ipn-filter-row input[type="text"],
.mh-ipn-filter-row select {
    margin-top: 3px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
}
.mh-ipn-filter-row button {
    padding: 7px 18px;
    background: #0e5b95;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}
.mh-ipn-filter-row button:hover { background: #0a4775; }

/* Lignes en warning : signature OK mais pas processed */
.mh-ipn-row-warn { background: #fffbeb; }

/* Colonne montant alignée à droite + couleur accent */
.mh-ipn-amount {
    text-align: right;
    white-space: nowrap;
    color: #0e5b95;
    font-variant-numeric: tabular-nums;
}

/* Lignes d'avoir dans la liste factures-pending */
.mh-fac-row-avoir { background: #fff7ed; }
.mh-fac-row-avoir td:first-child { border-left: 3px solid #ea580c; }

/* Cartes des jobs cron (page /nimda/cron) */
.mh-cron-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #0e5b95;
    border-radius: 6px;
    padding: 16px 20px;
    margin: 0 0 18px;
}
.mh-cron-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.mh-cron-card-ico { font-size: 24px; line-height: 1; }
.mh-cron-card-desc {
    margin: 0 0 14px;
    font-size: 13.5px;
    color: #444;
    line-height: 1.5;
}
.mh-cron-card-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 6px 0;
    font-size: 13px;
}
.mh-cron-card-label {
    color: #6b7280;
    font-weight: 600;
    font-size: 12px;
    min-width: 140px;
}
.mh-cron-card-url, .mh-cron-card-cmd {
    background: #1f2937;
    color: #e5e7eb;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Menlo','Consolas',monospace;
    font-size: 12px;
    display: inline-block;
    word-break: break-all;
    flex: 1;
    min-width: 0;
}
.mh-cron-card-cmd { display: block; width: 100%; margin: 8px 0; }

/* Footer outils techniques (dashboard admin) — discret */
.mh-admin-tools-footer {
    margin: 40px 0 0;
    padding: 14px 18px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}
.mh-admin-tools-label { margin-right: 8px; }
.mh-admin-tool-link {
    color: #9ca3af;
    text-decoration: none;
    border-bottom: 1px dashed #d1d5db;
    margin: 0 6px;
    transition: color .15s;
}
.mh-admin-tool-link:hover {
    color: #0e5b95;
    border-bottom-color: #0e5b95;
}

/* Cellule aperçu : boutons en colonne pour rester compact */
.mh-fac-preview-cell {
    white-space: nowrap;
}
.mh-fac-preview-cell a {
    display: inline-block;
    margin: 1px 2px;
    font-size: 11px;
}

/* Cellule action (Envoyer) + bouton Envoyer */
.mh-fac-action-cell { white-space: nowrap; }
.mh-fac-btn-send {
    background: #0e5b95;
    color: #fff;
    border: none;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background .15s;
}
.mh-fac-btn-send:hover:not(:disabled) { background: #0a4775; }
.mh-fac-btn-send:disabled {
    background: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}

/* Flash messages info/error (réutilise mh-presta-msg de base) */
.mh-presta-msg.is-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #2563eb;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 0 0 16px;
}

/* ============================================================
   Form de saisie facture manuelle
   ============================================================ */
.mh-fac-form fieldset {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
}
.mh-fac-form legend {
    font-weight: 700;
    color: #0e5b95;
    padding: 0 8px;
    font-size: 14px;
}
.mh-fac-form label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: #4b5563;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}
.mh-fac-form input[type="text"],
.mh-fac-form input[type="number"],
.mh-fac-form select,
.mh-fac-form textarea {
    margin-top: 4px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    color: #1f2937;
    width: 100%;
    box-sizing: border-box;
}
.mh-fac-form textarea { resize: vertical; min-height: 60px; }

.mh-fac-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 10px;
}
.mh-fac-row:last-child { margin-bottom: 0; }

.mh-fac-radio {
    display: inline-block;
    margin-right: 24px;
    font-weight: 600;
    cursor: pointer;
}
.mh-fac-radio input { margin-right: 6px; }

.mh-fac-lignes {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 0;
}
.mh-fac-lignes th,
.mh-fac-lignes td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}
.mh-fac-lignes th {
    background: #f9fafb;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.mh-fac-lignes input { font-size: 13px; padding: 5px 8px; }
.mh-fac-prix, .mh-fac-duree { text-align: right; font-variant-numeric: tabular-nums; }

.mh-fac-err {
    color: #c53030;
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
}

.mh-fac-submit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 0;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}
.mh-fac-btn-primary {
    padding: 11px 26px;
    background: #0e5b95;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.mh-fac-btn-primary:hover { background: #0a4775; }

#mh-fac-total { color: #0e5b95; font-size: 16px; }

/* Bloc totaux dans le form facture (HT / TVA / TTC empilés à droite) */
.mh-fac-totals {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    font-size: 14px;
}
.mh-fac-totals > div { color: #4b5563; }
.mh-fac-totals > div strong {
    color: #1f2937;
    font-variant-numeric: tabular-nums;
    display: inline-block;
    min-width: 100px;
    text-align: right;
}
.mh-fac-totals-ttc {
    font-size: 16px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.mh-fac-totals-ttc strong { color: #0e5b95 !important; font-size: 18px; }

/* Payload brut (raw_post) déplié */
.mh-ipn-raw {
    background: #1f2937;
    color: #e5e7eb;
    padding: 12px 14px;
    border-radius: 4px;
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 400px;
    overflow-y: auto;
    margin: 8px 0 0;
}

/* Pagination */
.mh-ipn-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0 0;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 13px;
}
.mh-ipn-pagination a {
    color: #0e5b95;
    text-decoration: none;
    font-weight: 600;
}
.mh-ipn-pagination a:hover { text-decoration: underline; }
.mh-ipn-pagination span { color: #6b7280; }

/* ===========================================================================
   /nimda/emails — Catalogue centralisé des emails
   =========================================================================== */

/* Bandeau intégrité (warning si partials manquants) */
.mh-emails-integrity {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
    font-size: 13px;
    color: #78350f;
}
.mh-emails-integrity-error { color: #991b1b; font-weight: 600; margin-right: 12px; }
.mh-emails-integrity-warn  { color: #92400e; font-weight: 600; margin-right: 12px; }
.mh-emails-integrity details { margin-top: 8px; }
.mh-emails-integrity summary { cursor: pointer; font-size: 12px; color: #92400e; }
.mh-emails-integrity ul { margin: 8px 0 0 18px; padding: 0; font-size: 12px; }
.mh-emails-integrity li { margin: 3px 0; }
.mh-emails-integrity li.mh-emails-integrity-error { color: #991b1b; }
.mh-emails-integrity li.mh-emails-integrity-warn  { color: #92400e; }
.mh-emails-integrity code { background: #fff; padding: 1px 6px; border-radius: 3px; font-size: 11px; }

/* Stats du haut */
.mh-emails-stats {
    display: flex;
    gap: 14px;
    margin: 18px 0 22px;
    flex-wrap: wrap;
}
.mh-emails-stat {
    flex: 1;
    min-width: 140px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #0E5B95;
    padding: 14px 18px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mh-emails-stat strong {
    font-size: 24px;
    font-weight: 700;
    color: #0E5B95;
    line-height: 1;
}
.mh-emails-stat span {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Titre de catégorie */
.mh-emails-cat-title {
    margin: 30px 0 10px;
    font-size: 16px;
    color: #1f2937;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    border-left: 3px solid #0E5B95;
}
.mh-emails-cat-title small {
    color: #6b7280;
    font-weight: normal;
    font-size: 12px;
    margin-left: 6px;
}

/* Table des templates */
.mh-emails-table { font-size: 13px; }
.mh-emails-table th { background: #f9fafb; font-size: 11px; }
.mh-emails-table td { vertical-align: top; padding: 10px 12px; }
.mh-emails-row-disabled { opacity: .55; }

.mh-emails-code {
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #1f2937;
    display: inline-block;
}
.mh-emails-desc {
    margin-top: 4px;
    font-size: 11.5px;
    color: #6b7280;
    line-height: 1.4;
    font-style: italic;
}
.mh-emails-subject {
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
}
.mh-emails-rcpt {
    font-size: 12px;
    color: #555;
    white-space: nowrap;
}
.mh-emails-file {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #4b5563;
    display: inline-block;
    margin-bottom: 2px;
}
.mh-emails-helper {
    color: #888;
    font-size: 11px;
}
.mh-emails-helper code {
    background: transparent;
    color: #6366f1;
    padding: 0;
    font-size: 11px;
}

/* Badges (statut + PJ + désactivé + mock manquant) */
.mh-emails-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.mh-emails-badge-php {
    background: #f0f9ff;
    color: #075985;
    border: 1px solid #bae6fd;
}
.mh-emails-badge-override {
    background: #fef3c7;
    color: #78350f;
    border: 1px solid #fcd34d;
}
.mh-emails-badge-pj {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
    margin-left: 6px;
    font-size: 10px;
}
.mh-emails-badge-disabled {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}
.mh-emails-badge-nomock {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-size: 10px;
}

/* Boutons d'action spécifiques */
.mh-emails-btn-preview,
.mh-emails-btn-test {
    margin-bottom: 4px;
    display: block;
    width: 100%;
}
.mh-emails-btn-primary {
    background: #0E5B95 !important;
    color: #fff;
    font-weight: 700;
    padding: 10px 18px !important;
    font-size: 13px !important;
}
.mh-emails-btn-primary:hover { background: #0a4775 !important; }

/* Modale Aperçu : large + en-tête neutre (override des couleurs delete) */
.mh-emails-modal-box {
    max-width: 900px !important;
    height: 90vh;
}
.mh-emails-modal-box .mh-admin-modal-head,
#mh-emails-test-modal .mh-admin-modal-head {
    background: linear-gradient(135deg, #0E5B95, #0a4775) !important;
}
.mh-emails-modal-body {
    flex: 1;
    padding: 0;
    background: #f4f6fa;
    overflow: hidden;
}
.mh-emails-modal-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
    display: block;
}

/* Modale Test (saisie email) */
.mh-emails-test-body label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    margin: 12px 0 6px;
}
.mh-emails-test-body input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
}
.mh-emails-test-body input[type="email"]:focus {
    outline: none;
    border-color: #0E5B95;
    box-shadow: 0 0 0 3px rgba(14,91,149,.15);
}
.mh-emails-test-body code {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #1f2937;
}

/* ===========================================================================
   /nimda/emails/preview-all — Aperçu empilé de tous les templates
   =========================================================================== */

.mh-emails-all-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.mh-emails-all-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.mh-emails-all-wrap {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 12px;
}
.mh-emails-all-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.mh-emails-all-item-head {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 16px;
}
.mh-emails-all-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.mh-emails-all-num {
    background: #0E5B95;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
}
.mh-emails-all-cat {
    font-size: 11px;
    color: #6b7280;
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}
.mh-emails-all-item-subject {
    font-size: 12.5px;
    color: #374151;
    line-height: 1.4;
}
.mh-emails-all-item-subject strong {
    color: #1f2937;
    margin-right: 4px;
}
.mh-emails-all-item-body {
    background: #f4f6fa;
    padding: 12px;
}
.mh-emails-all-iframe {
    width: 100%;
    height: 600px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    display: block;
}

.mh-emails-all-skipped {
    margin-top: 24px;
    padding: 14px 18px;
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    font-size: 13px;
}
.mh-emails-all-skipped summary {
    cursor: pointer;
    font-weight: 600;
    color: #92400e;
}
.mh-emails-all-skipped ul {
    margin: 10px 0 0 18px;
    padding: 0;
    color: #78350f;
}
.mh-emails-all-skipped em { color: #b45309; font-size: 12px; }

/* ===========================================================================
   /nimda/emails/edit/{code} — Éditeur visuel d'un template
   =========================================================================== */

/* Wrap plus large (sortir de la contrainte par défaut) */
.mh-emails-edit-wrap {
    max-width: 1600px;
}

/* En-tête de page */
.mh-emails-edit-head-section { margin-bottom: 16px; }
.mh-emails-edit-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
}
.mh-emails-edit-head h2 + code,
.mh-emails-edit-head code + .mh-emails-rcpt,
.mh-emails-edit-head .mh-emails-rcpt + .mh-emails-badge {
    margin-left: 8px;
}
.mh-emails-edit-actions-head {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Layout 2 colonnes : éditeur | preview */
.mh-emails-edit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: flex-start;
}
@media (max-width: 1100px) {
    .mh-emails-edit-layout { grid-template-columns: 1fr; }
}

/* Colonne gauche — éditeur */
.mh-emails-edit-col-left {
    background: #fff;
    border-radius: 8px;
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

/* Bloc "Tout pré-remplir" en haut de l'éditeur */
.mh-emails-edit-fill-all {
    background: #f5f3ff;
    border-left: 4px solid #6366f1;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 22px;
}
.mh-emails-edit-fill-all .mh-admin-btn-mini {
    display: inline-block;
    width: auto;
    margin-bottom: 0;
    padding: 10px 18px;
    font-size: 13px;
}
.mh-emails-edit-block {
    margin-bottom: 22px;
}
.mh-emails-edit-block label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #1f2937;
}
.mh-emails-edit-block label strong { color: #0E5B95; font-size: 14px; }
.mh-emails-edit-block label small {
    display: block;
    font-weight: normal;
    color: #6b7280;
    font-size: 11.5px;
    margin-top: 2px;
}

/* Inputs + textarea */
.mh-emails-edit-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
    font-family: inherit;
}
.mh-emails-edit-input:focus {
    outline: none;
    border-color: #0E5B95;
    box-shadow: 0 0 0 3px rgba(14,91,149,.15);
}
.mh-emails-edit-textarea {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 12.5px;
    line-height: 1.5;
    box-sizing: border-box;
    background: #fafafa;
    resize: vertical;
    min-height: 200px;
    tab-size: 4;
}
.mh-emails-edit-textarea:focus {
    outline: none;
    border-color: #0E5B95;
    box-shadow: 0 0 0 3px rgba(14,91,149,.15);
    background: #fff;
}
.mh-emails-edit-textarea-small { min-height: 120px; }

/* Source PHP affichée sous le sujet (référence) */
.mh-emails-edit-source-label {
    margin: 6px 0 0;
    font-size: 11.5px;
    color: #6b7280;
}
.mh-emails-edit-source-label code {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    color: #374151;
    font-size: 11.5px;
}

/* Toolbar (boutons import PHP) */
.mh-emails-edit-toolbar {
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Chips variables */
.mh-emails-edit-vars {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.mh-emails-edit-var-chip {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
    padding: 4px 10px;
    border-radius: 14px;
    font-family: Menlo, Consolas, monospace;
    font-size: 11.5px;
    cursor: pointer;
    transition: all .15s;
}
.mh-emails-edit-var-chip:hover {
    background: #5b21b6;
    color: #fff;
    transform: translateY(-1px);
}

/* Actions en bas (Save / Restore) */
.mh-emails-edit-actions-bottom {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.mh-emails-edit-actions-bottom .mh-admin-btn-mini {
    padding: 10px 18px;
    font-size: 13px;
}

/* Colonne droite — preview live (sticky pour rester visible en scroll) */
.mh-emails-edit-col-right {
    position: sticky;
    top: 20px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
}
.mh-emails-edit-preview-head {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.mh-emails-edit-preview-head strong { color: #0E5B95; }
.mh-emails-edit-preview-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 600;
}
.mh-emails-edit-preview-status.is-pending { background: #fef3c7; color: #92400e; }
.mh-emails-edit-preview-status.is-ok      { background: #d1fae5; color: #047857; }
.mh-emails-edit-preview-status.is-error   { background: #fee2e2; color: #991b1b; }
.mh-emails-edit-iframe {
    flex: 1;
    min-height: 600px;
    width: 100%;
    border: 0;
    background: #f4f6fa;
    display: block;
}

/* ===========================================================================
   /nimda/listemail — Liste emails B2B
   =========================================================================== */

/* ===========================================================================
   /nimda/trafic — Visites HTTP en direct
   =========================================================================== */

/* En-tête de page */
.mh-trafic-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
}
.mh-trafic-head h2 { margin: 0; }
.mh-trafic-head-actions { display: flex; gap: 10px; flex-shrink: 0; }
.mh-trafic-refresh-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1f2937;
    background: #ecfeff;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #67e8f9;
    cursor: pointer;
}
.mh-trafic-refresh-label input { cursor: pointer; }

/* Barre de filtres */
.mh-trafic-filters {
    background: #f9fafb;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin: 16px 0;
}
.mh-trafic-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.mh-trafic-filter-row label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11.5px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.mh-trafic-filter-row input,
.mh-trafic-filter-row select {
    padding: 7px 10px;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    font-size: 13px;
    background: #fff;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: #1f2937;
}
.mh-trafic-filter-grow { flex: 1; min-width: 180px; }
.mh-trafic-filter-grow input { width: 100%; box-sizing: border-box; }
.mh-trafic-filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* Stats compteurs (en haut du tableau) */
.mh-trafic-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 14px 0 18px;
}
.mh-trafic-stat {
    flex: 1;
    min-width: 140px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #0E5B95;
    padding: 12px 16px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mh-trafic-stat strong {
    font-size: 20px;
    line-height: 1.3;
    color: #1f2937;
    font-weight: 700;
}
.mh-trafic-stat span {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.mh-trafic-stat-visites { border-left-color: #0E5B95; }
.mh-trafic-stat-visites strong { color: #0E5B95; }
.mh-trafic-stat-uniques { border-left-color: #10b981; }
.mh-trafic-stat-uniques strong { color: #047857; }
.mh-trafic-stat-urls    { border-left-color: #6366f1; }
.mh-trafic-stat-urls    strong { color: #4338ca; }
.mh-trafic-stat-methods { border-left-color: #f59e0b; }
.mh-trafic-stat-status  { border-left-color: #94a3b8; }

/* Tableau visites */
.mh-trafic-table { font-size: 12.5px; width: 100%; }
.mh-trafic-table th { background: #f9fafb; font-size: 11px; }
.mh-trafic-table td { padding: 6px 9px; vertical-align: middle; }
.mh-trafic-cell-time {
    font-family: Menlo, Consolas, monospace;
    color: #6b7280;
    white-space: nowrap;
    font-size: 11.5px;
}
.mh-trafic-cell-url a {
    color: #0E5B95;
    text-decoration: none;
    font-family: Menlo, Consolas, monospace;
    font-size: 11.5px;
}
.mh-trafic-cell-url a:hover { text-decoration: underline; }
.mh-trafic-cell-ip {
    font-family: Menlo, Consolas, monospace;
    color: #475569;
    font-size: 11.5px;
    white-space: nowrap;
}
.mh-trafic-cell-ua  { font-size: 11.5px; color: #475569; }
.mh-trafic-cell-ref { font-size: 11px; color: #94a3b8; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

/* Pills méthode HTTP */
.mh-trafic-method-pill {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-family: Menlo, Consolas, monospace;
}

/* Pills status HTTP (couleurs sémantiques) */
.mh-trafic-status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-family: Menlo, Consolas, monospace;
    white-space: nowrap;
}
.mh-trafic-status-2xx { background: #d1fae5; color: #047857; }
.mh-trafic-status-3xx { background: #ddd6fe; color: #5b21b6; }
.mh-trafic-status-4xx { background: #fed7aa; color: #9a3412; }
.mh-trafic-status-5xx { background: #fecaca; color: #991b1b; }
.mh-trafic-status-1xx { background: #e5e7eb; color: #374151; }

/* Pills durée (perf) */
.mh-trafic-dur-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: Menlo, Consolas, monospace;
    white-space: nowrap;
}
.mh-trafic-dur-fast     { background: #d1fae5; color: #047857; }
.mh-trafic-dur-ok       { background: #e0f2fe; color: #075985; }
.mh-trafic-dur-slow     { background: #fed7aa; color: #9a3412; }
.mh-trafic-dur-verybad  { background: #fecaca; color: #991b1b; }

/* Colonnes cliquables pour tri */
.mh-trafic-sortable {
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.mh-trafic-sortable:hover { background: #e0f2fe !important; }
.mh-trafic-sortable .mh-sort-arrow {
    color: #0E5B95;
    font-size: 10px;
    margin-left: 2px;
}

/* TOP analytics (grid 2 colonnes responsive) */
.mh-trafic-tops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
    margin-top: 14px;
}
.mh-trafic-top-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
}
.mh-trafic-top-card h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #0E5B95;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 6px;
}
.mh-trafic-top-table { font-size: 12.5px; }
.mh-trafic-top-table th { background: #f9fafb; font-size: 11px; padding: 6px 8px; }
.mh-trafic-top-table td { padding: 6px 8px; vertical-align: top; }
.mh-trafic-top-table td:last-child { text-align: center; }
.mh-trafic-top-rank {
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 700;
    text-align: center;
    width: 28px;
    border-radius: 3px;
}
.mh-trafic-top-sub {
    font-size: 11px;
    color: #6b7280;
    font-weight: normal;
    font-style: italic;
}
.mh-trafic-top-table code {
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #4b5563;
}
.mh-trafic-top-table a {
    color: #0E5B95;
    text-decoration: none;
    font-weight: 600;
}

/* Bloc condensé dans le dashboard (section "Charge serveur") */
.mh-trafic-dashboard-box {
    margin-top: 16px;
    grid-column: 1 / -1;   /* prend toute la largeur dans la grid-2 */
}
.mh-trafic-dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.mh-trafic-dashboard-head h3 { margin: 0; font-size: 14px; color: #0E5B95; }
.mh-trafic-table-mini { font-size: 11.5px; }
.mh-trafic-table-mini td { padding: 4px 8px; }

/* Bloc URL publique de désinscription (en haut de /nimda/listemail) */
.mh-listemail-public-link {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 14px 0;
    font-size: 13px;
    color: #1e3a8a;
    line-height: 1.5;
}
.mh-listemail-public-link a {
    color: #1d4ed8;
    text-decoration: underline;
    font-weight: 600;
}
.mh-listemail-public-link small { color: #475569; }
.mh-listemail-public-link code {
    background: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    color: #1e3a8a;
}

/* Rapport post-import */
.mh-listemail-report {
    margin: 16px 0;
    padding: 14px 18px;
    border-radius: 8px;
    border-left: 5px solid #6b7280;
}
.mh-listemail-report-ok    { background: #ecfdf5; border-left-color: #10b981; color: #065f46; }
.mh-listemail-report-mixed { background: #fffbeb; border-left-color: #f59e0b; color: #78350f; }
.mh-listemail-report-ko    { background: #fef2f2; border-left-color: #dc2626; color: #991b1b; }
.mh-listemail-report-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}
.mh-listemail-report-stats {
    display: flex;
    gap: 14px;
    margin-bottom: 8px;
}
.mh-listemail-report-stat {
    background: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
}
.mh-listemail-report-stat strong { font-size: 22px; line-height: 1; }
.mh-listemail-report-stat span   { font-size: 11.5px; color: #6b7280; }
.mh-listemail-report-stat-ok strong { color: #047857; }
.mh-listemail-report-stat-ko strong { color: #991b1b; }
.mh-listemail-errors { margin-top: 12px; }
.mh-listemail-errors summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.mh-listemail-errors-table { margin-top: 8px; background: #fff; font-size: 12.5px; }
.mh-listemail-errors-table th { background: #f9fafb; }
.mh-listemail-errors-table code { font-size: 12px; }

/* Formulaire d'import */
.mh-listemail-form { margin-top: 10px; }
.mh-listemail-form-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 6px;
}
.mh-listemail-vds-input {
    width: 80px;
    padding: 6px 10px;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 6px;
}
.mh-listemail-textarea {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
    box-sizing: border-box;
    background: #fafafa;
    resize: vertical;
    min-height: 240px;
}
.mh-listemail-textarea:focus {
    outline: none;
    border-color: #0E5B95;
    box-shadow: 0 0 0 3px rgba(14,91,149,.15);
    background: #fff;
}
.mh-listemail-btn-submit {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    background: #0E5B95;
    color: #fff;
}
.mh-listemail-btn-submit:hover { background: #0a4775; }

/* Stats cards */
.mh-listemail-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 14px 0 24px;
}
.mh-listemail-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #94a3b8;
    padding: 14px 16px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mh-listemail-card strong {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: #1f2937;
}
.mh-listemail-card span {
    font-size: 11.5px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.mh-listemail-card-total   { border-left-color: #0E5B95; }
.mh-listemail-card-total   strong { color: #0E5B95; }
.mh-listemail-card-actifs  { border-left-color: #10b981; }
.mh-listemail-card-actifs  strong { color: #047857; }
.mh-listemail-card-bl      { border-left-color: #dc2626; }
.mh-listemail-card-bl      strong { color: #991b1b; }
.mh-listemail-card-jamais  { border-left-color: #94a3b8; }
.mh-listemail-card-recents { border-left-color: #6366f1; }
.mh-listemail-card-recents strong { color: #4338ca; }
.mh-listemail-card-stales  { border-left-color: #f59e0b; }
.mh-listemail-card-stales  strong { color: #b45309; }

/* Breakdowns (par langue, vds, type, domains) en grid 2 colonnes */
.mh-listemail-breakdowns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-top: 16px;
}
.mh-listemail-breakdown {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 14px 16px;
}
.mh-listemail-breakdown h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #0E5B95;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.mh-listemail-breakdown-table {
    font-size: 12.5px;
    width: 100%;
}
.mh-listemail-breakdown-table th,
.mh-listemail-breakdown-table td { padding: 6px 8px; }
.mh-listemail-breakdown-table td:nth-child(2),
.mh-listemail-breakdown-table td:nth-child(3) { text-align: right; }

/* Courbe mois (barres horizontales) */
.mh-listemail-month-section { margin-top: 22px; }
.mh-listemail-month-section h4 {
    font-size: 13px;
    color: #0E5B95;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 10px;
}
.mh-listemail-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mh-listemail-bar-row {
    display: grid;
    grid-template-columns: 70px 1fr 60px;
    gap: 10px;
    align-items: center;
    font-size: 12.5px;
}
.mh-listemail-bar-label { color: #555; font-weight: 600; }
.mh-listemail-bar-track {
    background: #f3f4f6;
    height: 18px;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.mh-listemail-bar-fill {
    background: linear-gradient(90deg, #0E5B95, #6366f1);
    height: 100%;
    display: block;
    border-radius: 3px;
    transition: width .3s;
}
.mh-listemail-bar-value { text-align: right; color: #1f2937; font-weight: 600; }

/* Bouton "✏️ Éditer" sur la liste catalogue */
.mh-emails-btn-edit {
    background: #6366f1 !important;
    color: #fff !important;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    width: 100%;
    text-align: center;
}
.mh-emails-btn-edit:hover { background: #4f46e5 !important; }
