/* ============================================================
   MarketingThrive — Frontend CSS complet
   Layout : Sidebar gauche + Contenu principal
   Design inspiré de l'image de référence (Sphère Santé)
   ============================================================ */

/* ---------- Variables ---------- */
:root {
    --mt-bg:            #eef2f7;
    --mt-white:         #ffffff;
    --mt-sidebar-w:     240px;
    --mt-primary:       #2563EB;
    --mt-primary-light: #EFF6FF;
    --mt-primary-dark:  #1d4ed8;
    --mt-green:         #16A34A;
    --mt-green-light:   #F0FDF4;
    --mt-orange:        #D97706;
    --mt-orange-light:  #FFFBEB;
    --mt-red:           #DC2626;
    --mt-red-light:     #FEF2F2;
    --mt-text:          #1e293b;
    --mt-text-soft:     #64748b;
    --mt-border:        #e2e8f0;
    --mt-shadow:        0 2px 12px rgba(0,0,0,.07);
    --mt-shadow-md:     0 4px 20px rgba(0,0,0,.10);
    --mt-radius:        14px;
    --mt-radius-sm:     8px;
    --mt-font:          -apple-system,'Inter',BlinkMacSystemFont,'Segoe UI',sans-serif;
}

/* ---------- Reset scope ---------- */
.mt-app *,
.mt-app *::before,
.mt-app *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.mt-app {
    font-family: var(--mt-font);
    color: var(--mt-text);
    display: flex;
    min-height: 700px;
    background: var(--mt-bg);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.12);
    position: relative;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.mt-sidebar {
    width: var(--mt-sidebar-w);
    min-width: var(--mt-sidebar-w);
    background: var(--mt-white);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--mt-border);
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

/* Logo */
.mt-sidebar-logo {
    padding: 22px 20px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--mt-border);
    text-decoration: none;
}
.mt-sidebar-logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--mt-primary) 0%, #60a5fa 100%);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.mt-sidebar-logo-icon svg { width: 20px; height: 20px; color: #fff; }
.mt-sidebar-logo-text { line-height: 1.2; }
.mt-sidebar-logo-text strong {
    display: block; font-size: 15px; font-weight: 800;
    color: var(--mt-text); letter-spacing: -.02em;
}
.mt-sidebar-logo-text span {
    font-size: 11px; color: var(--mt-text-soft); font-weight: 500;
}

/* Navigation */
.mt-sidebar-nav {
    flex: 1;
    padding: 14px 12px;
    overflow-y: auto;
}
.mt-nav-section {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--mt-text-soft);
    padding: 14px 8px 5px; margin-top: 4px;
    border-top: 1px solid var(--mt-border);
}
.mt-nav-section:first-of-type { border-top: none; }

/* Tableau de bord — item spécial en haut de la sidebar */
.mt-nav-item.mt-nav-dashboard {
    background: linear-gradient(135deg, var(--mt-primary-light) 0%, #dbeafe 100%) !important;
    color: var(--mt-primary) !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    margin-bottom: 6px !important;
    border: 1px solid rgba(37,99,235,.12) !important;
}
.mt-nav-item.mt-nav-dashboard svg { stroke: var(--mt-primary); }
.mt-nav-item.mt-nav-dashboard:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
}
.mt-nav-item.mt-nav-dashboard.active {
    background: linear-gradient(135deg, var(--mt-primary) 0%, var(--mt-primary-dark) 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 3px 12px rgba(37,99,235,.30) !important;
}
.mt-nav-item.mt-nav-dashboard.active svg { stroke: #fff; }
.mt-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--mt-text-soft);
    font-size: 14px; font-weight: 500;
    transition: all .18s;
    margin-bottom: 2px;
    position: relative;
    cursor: pointer;
    border: none; background: none; width: 100%; text-align: left;
}
.mt-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }
.mt-nav-item:hover { background: var(--mt-bg); color: var(--mt-text); }
.mt-nav-item.active {
    background: var(--mt-primary-light);
    color: var(--mt-primary);
    font-weight: 600;
}
.mt-nav-item.active svg { stroke: var(--mt-primary); }
.mt-nav-badge {
    margin-left: auto;
    background: var(--mt-primary);
    color: #fff; font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px;
}

/* User block */
.mt-sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid var(--mt-border);
    display: flex; align-items: center; gap: 10px;
}
.mt-sidebar-user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--mt-primary);
    color: #fff; font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.mt-sidebar-user-info { flex: 1; overflow: hidden; }
.mt-sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--mt-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-sidebar-user-role { font-size: 11px; color: var(--mt-text-soft); }

/* ============================================================
   CONTENU PRINCIPAL
   ============================================================ */
.mt-content {
    flex: 1;
    overflow-y: auto;
    background: var(--mt-bg);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header de page */
.mt-content-header {
    background: var(--mt-white);
    border-bottom: 1px solid var(--mt-border);
    padding: 18px 28px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    position: sticky; top: 0; z-index: 5;
}
.mt-content-header h1 {
    font-size: 22px !important; font-weight: 700 !important;
    color: var(--mt-text) !important; margin: 0 !important;
    padding: 0 !important; border: none !important; line-height: 1.2 !important;
}
.mt-content-header .mt-header-sub {
    font-size: 13px; color: var(--mt-text-soft); margin-top: 2px;
}
.mt-content-header .mt-header-actions { display: flex; align-items: center; gap: 10px; }

/* Zone scrollable */
.mt-content-body { padding: 24px 28px 40px; flex: 1; }

/* ============================================================
   MURAL D'ACCÈS
   ============================================================ */
.mt-login-wall {
    display: flex; align-items: center; justify-content: center;
    min-height: 400px; background: var(--mt-bg); border-radius: 18px;
}
.mt-login-box {
    background: var(--mt-white); border-radius: var(--mt-radius);
    box-shadow: var(--mt-shadow-md); padding: 48px 40px; text-align: center; max-width: 380px;
}
.mt-login-box svg { width: 52px; height: 52px; opacity: .22; margin-bottom: 14px; display: block; margin: 0 auto 14px; }
.mt-login-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--mt-text); }
.mt-login-box p  { font-size: 14px; color: var(--mt-text-soft); margin-bottom: 20px; line-height: 1.5; }
.mt-login-box a  {
    display: inline-block; background: var(--mt-primary); color: #fff;
    padding: 10px 24px; border-radius: var(--mt-radius-sm); font-weight: 600;
    text-decoration: none; font-size: 14px; transition: background .2s;
}
.mt-login-box a:hover { background: var(--mt-primary-dark); }

/* ============================================================
   KPI CARDS
   ============================================================ */
.mt-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px; margin-bottom: 14px;
}
@media (max-width: 1300px) { .mt-kpi-row { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 900px)  { .mt-kpi-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px)  { .mt-kpi-row { grid-template-columns: 1fr 1fr; } }

.mt-kpi {
    background: var(--mt-white); border-radius: var(--mt-radius);
    padding: 10px 12px 8px; box-shadow: var(--mt-shadow);
    position: relative; overflow: hidden; min-height: 118px;
    transition: transform .2s, box-shadow .2s;
}
.mt-kpi:hover { transform: translateY(-2px); box-shadow: var(--mt-shadow-md); }
.mt-kpi-title  { font-size: 11px; font-weight: 700; color: var(--mt-text-soft); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.mt-kpi-value  { font-size: 24px; font-weight: 800; line-height: 1; margin-bottom: 3px; }
.mt-kpi-label  { font-size: 11px; color: var(--mt-text-soft); }
.mt-kpi-blob   { position: absolute; bottom:0; right:0; width:60px; height:38px; opacity:.13; pointer-events:none; }
.mt-kpi.blue   .mt-kpi-value { color: var(--mt-primary); }
.mt-kpi.blue   .mt-kpi-blob  { background: radial-gradient(ellipse at bottom right, var(--mt-primary) 0%, transparent 70%); }
.mt-kpi.green  .mt-kpi-value { color: var(--mt-green); }
.mt-kpi.green  .mt-kpi-blob  { background: radial-gradient(ellipse at bottom right, var(--mt-green) 0%, transparent 70%); }
.mt-kpi.orange .mt-kpi-value { color: var(--mt-orange); }
.mt-kpi.orange .mt-kpi-blob  { background: radial-gradient(ellipse at bottom right, var(--mt-orange) 0%, transparent 70%); }
.mt-kpi.red    .mt-kpi-value { color: var(--mt-red); }
.mt-kpi.red    .mt-kpi-blob  { background: radial-gradient(ellipse at bottom right, var(--mt-red) 0%, transparent 70%); }
.mt-kpi.purple .mt-kpi-value { color: #7C3AED; }
.mt-kpi.purple .mt-kpi-blob  { background: radial-gradient(ellipse at bottom right, #7C3AED 0%, transparent 70%); }

/* ============================================================
   GRID LAYOUTS
   ============================================================ */
.mt-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.mt-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 900px) { .mt-grid-2,.mt-grid-3 { grid-template-columns: 1fr; } }

/* ============================================================
   CARDS
   ============================================================ */
.mt-card {
    background: var(--mt-white); border-radius: var(--mt-radius);
    box-shadow: var(--mt-shadow); overflow: hidden;
}
.mt-card-head {
    padding: 16px 20px 12px; border-bottom: 1px solid var(--mt-border);
    display: flex; align-items: center; justify-content: space-between;
}
.mt-card-title {
    font-size: 14px !important; font-weight: 700 !important;
    color: var(--mt-text) !important; margin: 0 !important;
}
.mt-card-body  { padding: 16px 20px; }
.mt-card-foot  { padding: 11px 20px; border-top: 1px solid var(--mt-border); text-align: center; }
.mt-card-foot a { font-size: 13px; color: var(--mt-primary); text-decoration: none; font-weight: 500; }

/* ============================================================
   CHECKLIST TÂCHES
   ============================================================ */
.mt-checklist { list-style: none; }
.mt-check-item {
    display: flex; align-items: center; gap: 11px;
    padding: 12px 20px; border-bottom: 1px solid var(--mt-border);
    transition: background .15s;
}
.mt-check-item:last-child { border-bottom: none; }
.mt-check-item:hover { background: var(--mt-bg); }
.mt-check-item.done label { text-decoration: line-through; color: var(--mt-text-soft); }
.mt-check-item input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--mt-primary); cursor: pointer; flex-shrink: 0; }
.mt-check-item label { flex: 1; font-size: 13.5px; cursor: pointer; line-height: 1.4; }
.mt-check-item label small { color: var(--mt-text-soft); }

/* Conteneur scrollable de la liste des tâches — ~5 items visibles */
.mt-tasks-scroll {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--mt-border) transparent;
}
.mt-tasks-scroll::-webkit-scrollbar { width: 5px; }
.mt-tasks-scroll::-webkit-scrollbar-track { background: transparent; }
.mt-tasks-scroll::-webkit-scrollbar-thumb { background: var(--mt-border); border-radius: 4px; }

/* Bloc Activités (paramètres) — scroll ~5 lignes + entête collante */
.mt-activite-scroll {
    max-height: 295px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--mt-border) transparent;
}
.mt-activite-scroll::-webkit-scrollbar { width: 5px; }
.mt-activite-scroll::-webkit-scrollbar-track { background: transparent; }
.mt-activite-scroll::-webkit-scrollbar-thumb { background: var(--mt-border); border-radius: 4px; }
.mt-activite-scroll .mt-table thead th {
    position: sticky; top: 0; z-index: 2; background: var(--mt-bg);
}

/* Bloc Tags — scroll ~2 catégories visibles (appliqué sur mt-card-body) */
.mt-tags-scroll {
    max-height: 430px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--mt-border) transparent;
}
.mt-tags-scroll::-webkit-scrollbar { width: 5px; }
.mt-tags-scroll::-webkit-scrollbar-track { background: transparent; }
.mt-tags-scroll::-webkit-scrollbar-thumb { background: var(--mt-border); border-radius: 4px; }

.mt-vol-badge {
    font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}
.mt-vol-badge.blue   { color: var(--mt-primary); background: var(--mt-primary-light); }
.mt-vol-badge.green  { color: var(--mt-green);   background: var(--mt-green-light); }
.mt-vol-badge.orange { color: var(--mt-orange);  background: var(--mt-orange-light); }
.mt-vol-badge.red    { color: var(--mt-red);     background: var(--mt-red-light); }

/* ============================================================
   LISTE ITEMS
   ============================================================ */
.mt-list { list-style: none; }
.mt-list-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; border-bottom: 1px solid var(--mt-border);
    transition: background .15s;
}
.mt-list-item:last-child { border-bottom: none; }
.mt-list-item:hover { background: var(--mt-bg); }
.mt-li-name { font-size: 14px; font-weight: 600; }
.mt-li-sub  { font-size: 12px; color: var(--mt-text-soft); margin-top: 2px; }

/* ============================================================
   BADGES
   ============================================================ */
.mt-badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.mt-badge.en_attente  { background: #f1f5f9; color: #64748b; }
.mt-badge.a_contacter { background: var(--mt-primary-light); color: var(--mt-primary); }
.mt-badge.contacte    { background: var(--mt-green-light);   color: var(--mt-green); }
.mt-badge.relance     { background: var(--mt-orange-light);  color: var(--mt-orange); }
.mt-badge.a_relancer  { background: var(--mt-orange-light);  color: var(--mt-orange); border: 1px solid var(--mt-orange); }
.mt-badge.converti    { background: var(--mt-green-light);   color: var(--mt-green); }
.mt-badge.perdu        { background: var(--mt-red-light);     color: var(--mt-red); }
.mt-badge.pas_de_besoin { background: #e2e8f0; color: #475569; }
.mt-badge.a_faire     { background: var(--mt-orange-light);  color: var(--mt-orange); }
.mt-badge.fait        { background: var(--mt-green-light);   color: var(--mt-green); }
.mt-badge.actif       { background: var(--mt-green-light);   color: var(--mt-green); }
.mt-badge.inactif     { background: var(--mt-red-light);     color: var(--mt-red); }

/* ============================================================
   SCORE BAR
   ============================================================ */
.mt-score { display: flex; align-items: center; gap: 8px; }
.mt-score-track { flex: 1; height: 5px; background: var(--mt-border); border-radius: 3px; overflow: hidden; }
.mt-score-fill  { height: 100%; border-radius: 3px; transition: width .4s; }
.mt-score-fill.high   { background: var(--mt-green); }
.mt-score-fill.medium { background: var(--mt-orange); }
.mt-score-fill.low    { background: var(--mt-primary); }
.mt-score-num { font-size: 12px; font-weight: 700; color: var(--mt-text-soft); width: 26px; text-align: right; }

/* ============================================================
   BOUTONS
   ============================================================ */
.mt-btn {
    display: inline-flex !important; align-items: center !important; gap: 6px !important;
    padding: 8px 16px !important; border-radius: var(--mt-radius-sm) !important;
    font-size: 13px !important; font-weight: 600 !important; cursor: pointer !important;
    border: none !important; outline: none !important;
    text-decoration: none !important; transition: all .2s !important;
    white-space: nowrap !important; font-family: var(--mt-font) !important;
    line-height: 1.4 !important; box-shadow: none !important; text-shadow: none !important;
}
.mt-btn-primary   { background: var(--mt-primary) !important;  color: #fff !important; }
.mt-btn-primary:hover { background: var(--mt-primary-dark) !important; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.28) !important; }
.mt-btn-secondary { background: var(--mt-white) !important; color: var(--mt-text) !important; border: 1.5px solid var(--mt-border) !important; }
.mt-btn-secondary:hover { border-color: var(--mt-primary) !important; color: var(--mt-primary) !important; }
.mt-btn-success   { background: var(--mt-green) !important;  color: #fff !important; }
.mt-btn-success:hover { background: #15803d !important; }
.mt-btn-danger    { background: var(--mt-red) !important;    color: #fff !important; }
.mt-btn-danger:hover  { background: #b91c1c !important; }
.mt-btn-sm { padding: 5px 11px !important; font-size: 12px !important; }

/* ============================================================
   TABLEAU
   ============================================================ */
.mt-table-wrap { overflow-x: auto; }
.mt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mt-table th {
    background: var(--mt-bg); color: var(--mt-text-soft);
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; padding: 10px 14px; text-align: left;
    white-space: nowrap; border-bottom: 1px solid var(--mt-border);
}
.mt-table td { padding: 11px 14px; border-bottom: 1px solid var(--mt-border); vertical-align: middle; }
.mt-table tr:last-child td { border-bottom: none; }
.mt-table tr:hover td { background: var(--mt-bg); }
.mt-td-actions { display: flex; gap: 5px; }

/* Tableaux avec entête et colonnes figées */
.mt-frozen-1col,
.mt-frozen-2col { overflow: auto; max-height: 65vh; }

.mt-frozen-1col .mt-table thead th,
.mt-frozen-2col .mt-table thead th { position: sticky; top: 0; z-index: 2; }

.mt-frozen-1col .mt-table th:first-child,
.mt-frozen-1col .mt-table td:first-child,
.mt-frozen-2col .mt-table th:first-child,
.mt-frozen-2col .mt-table td:first-child {
    position: sticky; left: 0; z-index: 1;
    background: #f0fdf4; box-shadow: inset -1px 0 0 #bbf7d0;
}
.mt-frozen-1col .mt-table thead th:first-child,
.mt-frozen-2col .mt-table thead th:first-child { z-index: 3; background: #dcfce7; }

.mt-frozen-2col .mt-table th:nth-child(2),
.mt-frozen-2col .mt-table td:nth-child(2) {
    position: sticky; z-index: 1;
    background: #f0fdf4; box-shadow: inset -2px 0 0 #bbf7d0;
}
.mt-frozen-2col .mt-table thead th:nth-child(2) { z-index: 3; background: #dcfce7; }

.mt-frozen-1col .mt-table tr:hover td:first-child,
.mt-frozen-2col .mt-table tr:hover td:first-child,
.mt-frozen-2col .mt-table tr:hover td:nth-child(2) { background: #dcfce7; }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.mt-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .mt-form-grid { grid-template-columns: 1fr; } }
.mt-form-group { display: flex; flex-direction: column; gap: 5px; }
.mt-form-group.full { grid-column: 1 / -1; }
.mt-label { font-size: 13px; font-weight: 600; color: var(--mt-text); }
.mt-input, .mt-select, .mt-textarea {
    padding: 9px 12px; border: 1.5px solid var(--mt-border);
    border-radius: var(--mt-radius-sm); font-size: 13.5px;
    font-family: var(--mt-font); color: var(--mt-text); background: var(--mt-white);
    transition: border .2s, box-shadow .2s; outline: none; width: 100%;
}
.mt-select:disabled { opacity: .6; cursor: not-allowed; background: var(--mt-bg-soft, #f7f8fa); }
.mt-input:focus, .mt-select:focus, .mt-textarea:focus {
    border-color: var(--mt-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.mt-textarea { resize: vertical; min-height: 80px; }
#mt-email-message,
#mt-cm-email-message { font-family: Arial, Helvetica, sans-serif !important; font-size: 14px !important; }
.mt-input-help { font-size: 11.5px; color: var(--mt-text-soft); margin-top: 3px; }

/* ============================================================
   SEARCHABLE SELECT
   ============================================================ */
.mt-ss-wrapper { position: relative; width: 100%; }
.mt-ss-trigger {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 12px; border: 1.5px solid var(--mt-border);
    border-radius: var(--mt-radius-sm); font-size: 13.5px;
    font-family: var(--mt-font); color: var(--mt-text); background: var(--mt-white);
    cursor: pointer; width: 100%; box-sizing: border-box; min-height: 40px;
    transition: border .2s, box-shadow .2s;
}
.mt-ss-wrapper.open .mt-ss-trigger,
.mt-ss-trigger:focus {
    border-color: var(--mt-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    outline: none;
}
.mt-ss-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-ss-chevron {
    flex-shrink: 0; margin-left: 6px; color: var(--mt-text-soft);
    transition: transform .2s;
}
.mt-ss-wrapper.open .mt-ss-chevron { transform: rotate(180deg); }
.mt-ss-dropdown {
    display: none; position: absolute; top: calc(100% + 3px); left: 0; right: 0;
    background: var(--mt-white); border: 1.5px solid var(--mt-border);
    border-radius: var(--mt-radius-sm); box-shadow: 0 6px 20px rgba(0,0,0,.13);
    z-index: 100001;
}
.mt-ss-wrapper.open .mt-ss-dropdown { display: block; }
.mt-ss-search {
    display: block; width: 100%; box-sizing: border-box;
    padding: 8px 10px; border: none; border-bottom: 1px solid var(--mt-border);
    font-size: 13px; font-family: var(--mt-font); outline: none; background: transparent;
    border-radius: var(--mt-radius-sm) var(--mt-radius-sm) 0 0;
}
.mt-ss-list {
    list-style: none; margin: 0; padding: 4px 0;
    max-height: 220px; overflow-y: auto;
}
.mt-ss-list li {
    padding: 8px 12px; font-size: 13.5px; cursor: pointer;
    color: var(--mt-text); transition: background .1s; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.mt-ss-list li:hover,
.mt-ss-list li.mt-ss-focused { background: var(--mt-bg-soft, #f5f7fa); }
.mt-ss-list li.selected { color: var(--mt-primary); font-weight: 500; }
.mt-ss-list li.mt-ss-hidden { display: none; }
.mt-ss-empty {
    padding: 10px 12px; font-size: 13px;
    color: var(--mt-text-soft); text-align: center; margin: 0;
}
.mt-input-sm, .mt-select-sm { padding: 6px 8px !important; font-size: 12.5px !important; }

/* ============================================================
   MODAL
   ============================================================ */
.mt-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 99999;
    align-items: center; justify-content: center;
}
.mt-modal-overlay.open { display: flex; }
.mt-modal {
    background: var(--mt-white); border-radius: var(--mt-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
    animation: mtIn .2s ease;
}
.mt-modal-lg { max-width: 660px; }
.mt-modal-head {
    padding: 18px 22px 14px; border-bottom: 1px solid var(--mt-border);
    display: flex; align-items: center; justify-content: space-between;
}
.mt-modal-title { font-size: 16px !important; font-weight: 700 !important; margin: 0 !important; color: var(--mt-text) !important; }
.mt-modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--mt-text-soft); line-height: 1; padding: 2px 4px; }
.mt-modal-body { padding: 20px 22px; }
.mt-modal-foot { padding: 14px 22px; border-top: 1px solid var(--mt-border); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes mtIn { from { opacity:0; transform:translateY(-14px); } to { opacity:1; transform:translateY(0); } }

/* ============================================================
   OPPORTUNITÉ CARD
   ============================================================ */
.mt-opportunity {
    background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
    border-radius: var(--mt-radius); padding: 22px; color: #fff;
    box-shadow: 0 6px 24px rgba(37,99,235,.3);
}
.mt-opportunity h3 { font-size: 14px !important; font-weight: 700 !important; margin: 0 0 14px !important; opacity: .9; color: #fff !important; }
.mt-opp-item { background: rgba(255,255,255,.14); border-radius: 10px; padding: 11px 14px; margin-bottom: 8px; backdrop-filter: blur(4px); }
.mt-opp-item:last-child { margin-bottom: 0; }
.mt-opp-label { font-size: 11px; opacity: .75; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.mt-opp-value { font-size: 13px; font-weight: 600; }

/* ============================================================
   ACTIONS RÉCENTES
   ============================================================ */
.mt-actions-list { list-style: none; }
.mt-action-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 20px; border-bottom: 1px solid var(--mt-border);
}
.mt-action-item:last-child { border-bottom: none; }
.mt-action-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--mt-primary-light); color: var(--mt-primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 14px;
}
.mt-action-name   { font-size: 13.5px; font-weight: 600; }
.mt-action-detail { font-size: 12px; color: var(--mt-text-soft); margin-top: 2px; }
.mt-action-time   { font-size: 11px; color: var(--mt-text-soft); white-space: nowrap; margin-left: auto; padding-left: 10px; }

/* ============================================================
   CALENDRIER
   ============================================================ */
.mt-calendar { width: 100%; border-collapse: collapse; }
.mt-calendar th {
    background: var(--mt-bg); font-size: 11px; font-weight: 700;
    text-transform: uppercase; color: var(--mt-text-soft); padding: 10px; text-align: center;
}
.mt-calendar td {
    width: calc(100%/7); min-height: 80px; vertical-align: top;
    border: 1px solid var(--mt-border); padding: 7px; cursor: pointer; transition: background .15s;
}
.mt-calendar td:hover { background: var(--mt-bg); }
.mt-calendar td.today { background: var(--mt-primary-light); }
.mt-calendar td.today .mt-day-num { color: var(--mt-primary); font-weight: 700; }
.mt-day-num { font-size: 13px; font-weight: 500; margin-bottom: 4px; display: block; }
.mt-cal-task {
    display: block; font-size: 10.5px; padding: 2px 5px;
    border-radius: 4px; margin-bottom: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-decoration: none;
}
.mt-cal-task.prospection { background: var(--mt-primary-light); color: var(--mt-primary); }
.mt-cal-task.relance     { background: var(--mt-orange-light);  color: var(--mt-orange); }
.mt-cal-task.contenu     { background: var(--mt-green-light);   color: var(--mt-green); }

/* ============================================================
   NOTICES / ALERTS
   ============================================================ */
.mt-notice {
    padding: 11px 16px; border-radius: var(--mt-radius-sm);
    font-size: 13px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px; line-height: 1.4;
}
.mt-notice.success { background: var(--mt-green-light);   color: #166534; border-left: 3px solid var(--mt-green); }
.mt-notice.error   { background: var(--mt-red-light);     color: #991b1b; border-left: 3px solid var(--mt-red); }
.mt-notice.info    { background: var(--mt-primary-light); color: #1e40af; border-left: 3px solid var(--mt-primary); }
.mt-notice.warning { background: var(--mt-orange-light);  color: #92400e; border-left: 3px solid var(--mt-orange); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.mt-empty { text-align: center; padding: 40px 20px; color: var(--mt-text-soft); }
.mt-empty svg { width: 52px; height: 52px; opacity: .25; margin: 0 auto 12px; display: block; }
.mt-empty p   { font-size: 14px; margin-bottom: 14px; }

/* ============================================================
   FILTRES / SEARCH BAR
   ============================================================ */
.mt-filters {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 14px 20px; background: var(--mt-white);
    border-radius: var(--mt-radius); box-shadow: var(--mt-shadow); margin-bottom: 18px;
}
.mt-search { position: relative; }
.mt-search input { padding-left: 34px; width: 240px; }
.mt-search svg {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    width: 15px; height: 15px; color: var(--mt-text-soft); pointer-events: none;
}

/* ============================================================
   PERSONA CARDS
   ============================================================ */
.mt-persona-card .mt-stars { color: #f59e0b; letter-spacing: 2px; font-size: 13px; }
.mt-persona-stat { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--mt-border); }
.mt-persona-stat:last-child { border-bottom: none; }
.mt-persona-stat span:first-child { color: var(--mt-text-soft); }
.mt-persona-stat span:last-child  { font-weight: 600; }

/* Carte cliquable — agrandissement */
.mt-persona-card { cursor: pointer; transition: transform .18s, box-shadow .18s; }
.mt-persona-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(37,99,235,.13); }
.mt-persona-card .mt-card-foot button,
.mt-persona-card .mt-card-foot a,
.mt-persona-card .mt-open-assign-pb { cursor: pointer; }

/* Modal XL — détail persona */
.mt-modal-xl { max-width: 760px; width: 96vw; }
.mt-detail-section { margin-bottom: 20px; }
.mt-detail-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--mt-text-soft); margin: 0 0 10px; padding-bottom: 6px;
    border-bottom: 1px solid var(--mt-border); display: flex; align-items: center; gap: 5px;
}
.mt-detail-pb-item {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 10px; padding: 7px 10px; border-radius: 8px; background: #F8FAFC; margin-bottom: 5px;
}
.mt-detail-pb-item:last-child { margin-bottom: 0; }
.mt-detail-svc-item {
    border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; background: #EFF6FF;
}
.mt-detail-svc-item:last-child { margin-bottom: 0; }
.mt-detail-svc-item:nth-child(n+2) { background: #F8FAFC; }
.mt-detail-svc-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; }
.mt-detail-svc-arg { font-size: 11px; color: #64748B; line-height: 1.4; margin: 4px 0 0; padding-left: 10px; border-left: 2px solid #BFDBFE; }

/* ============================================================
   MOBILE SIDEBAR TOGGLE
   ============================================================ */
.mt-menu-toggle {
    display: none; background: var(--mt-white); border: 1px solid var(--mt-border);
    border-radius: 8px; padding: 8px 10px; cursor: pointer; align-items: center;
    gap: 6px; font-size: 13px; font-weight: 600; color: var(--mt-text);
}
.mt-menu-toggle svg { width: 18px; height: 18px; }

@media (max-width: 768px) {
    .mt-app { flex-direction: column; }
    .mt-sidebar {
        width: 100%; min-width: 100%; border-right: none;
        border-bottom: 1px solid var(--mt-border);
        display: none;
    }
    .mt-sidebar.open { display: flex; }
    .mt-menu-toggle { display: flex; }
    .mt-content-body { padding: 16px 14px 28px; }
    .mt-kpi-row { grid-template-columns: 1fr 1fr; }
    .mt-sidebar-nav { display: flex; flex-wrap: wrap; padding: 8px; }
    .mt-nav-item    { flex: 1; min-width: 120px; justify-content: center; }
    .mt-nav-item span { display: none; }
    .mt-nav-section { display: none; }
}

/* ============================================================
   ONGLETS HORIZONTAUX (paramètres)
   ============================================================ */
.mt-htabs-wrap {
    margin-bottom: 22px;
}
.mt-htabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background: var(--mt-white);
    border-radius: var(--mt-radius);
    box-shadow: var(--mt-shadow);
    padding: 6px;
}
.mt-htab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 9px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--mt-text-soft);
    white-space: nowrap;
    transition: all .18s;
    border: none;
    background: none;
    cursor: pointer;
}
.mt-htab:hover { background: var(--mt-bg); color: var(--mt-text); }
.mt-htab.active {
    background: var(--mt-primary);
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.mt-htab-icon  { font-size: 15px; line-height: 1; }
.mt-htab-label { line-height: 1; }

@media (max-width: 768px) {
    .mt-htabs { gap: 2px; padding: 4px; }
    .mt-htab  { padding: 8px 11px; font-size: 12px; gap: 5px; }
    .mt-htab-label { display: none; }
    .mt-htab-icon  { font-size: 17px; }
}

/* ============================================================
   ÉDITEUR RICH TEXT — SIGNATURES
   ============================================================ */
.mt-sig-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--mt-bg);
    border: 1px solid var(--mt-border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}
.mt-sig-tool {
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--mt-text);
    line-height: 1.4;
    transition: background .15s, border-color .15s;
}
.mt-sig-tool:hover { background: var(--mt-white); border-color: var(--mt-border); }
.mt-sig-color-wrap {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    color: var(--mt-text);
    transition: background .15s, border-color .15s;
    position: relative;
}
.mt-sig-color-wrap:hover { background: var(--mt-white); border-color: var(--mt-border); }
.mt-sig-size {
    font-size: 12px;
    border: 1px solid var(--mt-border);
    border-radius: 5px;
    padding: 3px 6px;
    background: var(--mt-white);
    color: var(--mt-text);
    cursor: pointer;
}
.mt-sig-separator {
    width: 1px;
    height: 18px;
    background: var(--mt-border);
    margin: 0 2px;
    flex-shrink: 0;
}
.mt-sig-editor {
    min-height: 140px;
    padding: 12px 14px;
    border: 1px solid var(--mt-border);
    border-radius: 0 0 8px 8px;
    background: var(--mt-white);
    font-size: 14px;
    line-height: 1.7;
    color: var(--mt-text);
    outline: none;
    resize: vertical;
    overflow-y: auto;
}
.mt-sig-editor:focus { border-color: var(--mt-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.mt-sig-editor a { color: var(--mt-primary); }

/* ============================================================
   PREVIEW SIGNATURE — FORMULAIRES EMAIL
   ============================================================ */
.mt-email-sig-preview {
    padding: 12px 14px;
    border: 1px solid var(--mt-border);
    border-top: 2px solid var(--mt-border);
    border-radius: 8px;
    background: var(--mt-bg);
    font-size: 14px;
    line-height: 1.7;
    color: var(--mt-text);
}
.mt-email-sig-preview:empty { display: none; }
.mt-email-sig-preview a { color: var(--mt-primary); }

/* ============================================================
   SOUS-ONGLETS HORIZONTAUX (ex : messagerie)
   ============================================================ */
.mt-stabs-wrap {
    margin-bottom: 24px;
}
.mt-stabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--mt-border);
}
.mt-stab {
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--mt-text-soft);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.mt-stab:hover { color: var(--mt-text); }
.mt-stab.active {
    color: var(--mt-primary);
    border-bottom-color: var(--mt-primary);
    font-weight: 600;
}

/* ============================================================
   CHART CONTAINER
   ============================================================ */
.mt-chart-wrap { position: relative; height: 210px; padding: 4px 0; }

/* ============================================================
   SPINNER
   ============================================================ */
.mt-spinner {
    display: inline-block; width: 18px; height: 18px;
    border: 2px solid var(--mt-border); border-top-color: var(--mt-primary);
    border-radius: 50%; animation: mtSpin .7s linear infinite;
}
@keyframes mtSpin { to { transform: rotate(360deg); } }

/* ============================================================
   FICHE ENTREPRISE — Modal CRM
   ============================================================ */

/* Bouton nom cliquable dans le tableau */
button.mt-fiche-trigger {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font: inherit !important;
    font-weight: 500 !important;
    color: var(--mt-primary) !important;
    cursor: pointer !important;
    text-align: left !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    text-decoration-color: transparent !important;
    transition: text-decoration-color .15s !important;
}
button.mt-fiche-trigger:hover,
button.mt-fiche-trigger:focus,
button.mt-fiche-trigger:active {
    background: none !important;
    box-shadow: none !important;
    color: var(--mt-primary) !important;
    text-decoration-color: var(--mt-primary) !important;
}

/* Modal grande largeur */
.mt-modal-fiche {
    max-width: 980px !important;
    width: 96% !important;
}
.mt-fiche-body {
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

/* Chargement */
.mt-fiche-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 40px;
    justify-content: center;
    color: var(--mt-text-soft);
    font-size: 14px;
}

/* Grille 2 colonnes (infos + contacts) */
.mt-fiche-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 700px) {
    .mt-fiche-top { grid-template-columns: 1fr; }
}

/* Bloc infos */
.mt-fiche-card {
    background: var(--mt-white);
    border: 1px solid var(--mt-border);
    border-radius: var(--mt-radius-sm);
    padding: 16px;
}
.mt-fiche-card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--mt-text-soft);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--mt-border);
}
.mt-fiche-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    font-size: 13px;
}
.mt-fiche-row .mt-fiche-label {
    color: var(--mt-text-soft);
    white-space: nowrap;
}
.mt-fiche-row .mt-fiche-val {
    color: var(--mt-text);
    font-weight: 500;
    word-break: break-word;
}
.mt-fiche-row a { color: var(--mt-primary); }
.mt-fiche-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* Bloc Notes dans la fiche */
.mt-fiche-notes-block {
    background: var(--mt-white);
    border: 1px solid var(--mt-border);
    border-radius: var(--mt-radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}
.mt-fiche-notes-content {
    font-size: 13px;
    color: var(--mt-text);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Contacts dans la fiche */
.mt-fiche-contact {
    padding: 10px 0;
    border-bottom: 1px solid var(--mt-border);
    font-size: 13px;
}
.mt-fiche-contact:last-child { border-bottom: none; }
.mt-fiche-contact-name {
    font-weight: 600;
    color: var(--mt-text);
    margin-bottom: 2px;
}
.mt-fiche-contact-meta {
    color: var(--mt-text-soft);
    font-size: 12px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ─── Timeline ─────────────────────────────────────────────── */
.mt-timeline-section {
    margin-bottom: 20px;
}
.mt-timeline-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.mt-timeline-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--mt-text-soft);
}
.mt-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mt-timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    background: var(--mt-white);
    border: 1px solid var(--mt-border);
    border-radius: var(--mt-radius-sm);
    position: relative;
}
.mt-timeline-item.statut-fait { border-left: 3px solid var(--mt-green); }
.mt-timeline-item.statut-a_faire { border-left: 3px solid var(--mt-orange); }
.mt-timeline-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}
.mt-timeline-icon.type-email   { background: #EFF6FF; }
.mt-timeline-icon.type-appel   { background: #F0FDF4; }
.mt-timeline-icon.type-note    { background: #FEFCE8; }
.mt-timeline-icon.type-tache   { background: #F5F3FF; }
.mt-timeline-icon.type-rdv     { background: #FFF7ED; }
.mt-timeline-content { flex: 1; min-width: 0; }
.mt-timeline-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 3px;
}
.mt-timeline-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 7px;
    border-radius: 20px;
}
.mt-timeline-type.type-email { background:#EFF6FF; color:var(--mt-primary); }
.mt-timeline-type.type-appel { background:#F0FDF4; color:var(--mt-green);   }
.mt-timeline-type.type-note  { background:#FEFCE8; color:#A16207;           }
.mt-timeline-type.type-tache { background:#F5F3FF; color:var(--mt-purple);  }
.mt-timeline-type.type-rdv   { background:#FFF7ED; color:var(--mt-orange);  }
.mt-timeline-date  { font-size: 12px; color: var(--mt-text-soft); }
.mt-timeline-statut {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
}
.mt-timeline-statut.fait    { background: #F0FDF4; color: var(--mt-green);  }
.mt-timeline-statut.a_faire { background: #FFF7ED; color: var(--mt-orange); }
.mt-timeline-titre {
    font-size: 13px;
    font-weight: 600;
    color: var(--mt-text);
    margin-bottom: 2px;
}
.mt-timeline-contenu {
    font-size: 12px;
    color: var(--mt-text-soft);
    white-space: pre-wrap;
    word-break: break-word;
}
.mt-timeline-contact {
    font-size: 11px;
    color: var(--mt-text-soft);
    margin-top: 3px;
}
.mt-tl-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-self: flex-start;
    flex-shrink: 0;
}
.mt-timeline-edit,
.mt-timeline-del {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    color: var(--mt-text-soft) !important;
    font-size: 15px !important;
    line-height: 1 !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    transition: color .15s, background .15s !important;
}
.mt-timeline-edit:hover,
.mt-timeline-edit:focus  { color: var(--mt-primary) !important; background: var(--mt-primary-light) !important; }
.mt-timeline-del:hover,
.mt-timeline-del:focus   { color: var(--mt-red) !important;     background: var(--mt-red-light) !important; }
.mt-timeline-empty {
    text-align: center;
    padding: 24px;
    color: var(--mt-text-soft);
    font-size: 13px;
    background: var(--mt-white);
    border: 1px dashed var(--mt-border);
    border-radius: var(--mt-radius-sm);
}
/* ─── Email timeline cliquable ───────────────────────────── */
.mt-email-viewable {
    cursor: pointer;
    border-radius: 6px;
    padding: 3px 5px;
    margin: -3px -5px;
    transition: background .15s;
}
.mt-email-viewable:hover { background: #EFF6FF; }
.mt-email-view-hint {
    font-size: 11px;
    color: var(--mt-primary);
    margin-top: 4px;
    opacity: 0;
    transition: opacity .15s;
}
.mt-email-viewable:hover .mt-email-view-hint { opacity: 1; }

/* ─── Modal lecture email complet ────────────────────────── */
.mt-modal-email-view { max-width: 680px !important; }
.mt-email-view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 13px;
    color: var(--mt-text-soft);
    margin-bottom: 14px;
}
.mt-email-view-meta strong { color: var(--mt-text); }
.mt-email-view-separator {
    border-top: 1px solid var(--mt-border);
    margin-bottom: 16px;
}
.mt-email-view-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--mt-text);
    background: var(--mt-bg);
    border-radius: 8px;
    padding: 16px 20px;
    word-break: break-word;
    max-height: 420px;
    overflow-y: auto;
}

/* ─── Formulaire ajout activité ───────────────────────────── */
.mt-fiche-add-section {
    background: var(--mt-white);
    border: 1px solid var(--mt-border);
    border-radius: var(--mt-radius-sm);
    overflow: hidden;
}
.mt-fiche-add-toggle {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 12px 16px !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--mt-primary) !important;
    text-align: left !important;
    transition: background .15s !important;
}
.mt-fiche-add-toggle:hover { background: var(--mt-primary-light) !important; }
.mt-fiche-add-toggle:focus,
.mt-fiche-add-toggle:active { background: none !important; box-shadow: none !important; outline: none !important; color: var(--mt-primary) !important; }
.mt-fiche-add-form {
    padding: 0 16px 16px;
    border-top: 1px solid var(--mt-border);
    display: none;
}
.mt-fiche-add-form.open { display: block; }

/* ─── Section envoi email ─────────────────────────────────── */
.mt-fiche-email-section {
    margin-top: 10px;
}
.mt-fiche-email-toggle {
    color: var(--mt-purple) !important;
}
.mt-fiche-email-toggle:hover {
    background: #f5f3ff !important;
}
.mt-fiche-email-toggle:focus,
.mt-fiche-email-toggle:active {
    background: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--mt-purple) !important;
}

/* ─── Sous-onglets horizontaux (réseaux sociaux…) ─────────── */
.mt-subtabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--mt-border);
    margin-bottom: 24px;
}
.mt-subtab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--mt-text-soft);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: color .15s, border-color .15s, background .15s;
}
.mt-subtab:hover {
    color: var(--mt-primary);
    background: rgba(37, 99, 235, .05);
}
.mt-subtab.active {
    color: var(--mt-primary);
    border-bottom-color: var(--mt-primary);
    background: rgba(37, 99, 235, .06);
    font-weight: 600;
}

/* ============================================================
   COMBOBOX — champ avec recherche intégrée
   ============================================================ */
.mt-combobox { position: relative; }
.mt-combobox-list {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: var(--mt-bg);
    border: 1px solid var(--mt-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    max-height: 220px;
    overflow-y: auto;
    z-index: 999;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    display: none;
}
.mt-combobox-list li {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--mt-text);
    line-height: 1.4;
}
.mt-combobox-list li:hover,
.mt-combobox-list li.mt-cb-active {
    background: rgba(37,99,235,.07);
    color: var(--mt-primary);
}

/* ─── Toggle switch ─────────────────────────────────────────── */
.mt-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.mt-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.mt-toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--mt-border); border-radius: 24px;
    transition: background .2s;
}
.mt-toggle-slider:before {
    content: ''; position: absolute;
    height: 18px; width: 18px; left: 3px; bottom: 3px;
    background: var(--mt-white); border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.mt-toggle input:checked + .mt-toggle-slider { background: var(--mt-green); }
.mt-toggle input:checked + .mt-toggle-slider:before { transform: translateX(20px); }

/* ─── Cartes règles automatiques ────────────────────────────── */
.mt-auto-rule-card {
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    transition: box-shadow .2s;
}
.mt-auto-rule-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.mt-auto-rule-icon {
    width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.mt-auto-rule-icon.orange { background: #FFF7ED; color: var(--mt-orange); }
.mt-auto-rule-icon.blue   { background: #EFF6FF; color: var(--mt-primary); }
.mt-auto-rule-icon.green  { background: #F0FDF4; color: var(--mt-green); }

/* ─── Centre Emails — sélecteur de période ───────────────── */
.mt-email-periods {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}
.mt-period-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--mt-border);
    border-radius: 20px;
    background: var(--mt-bg);
    color: var(--mt-text-soft);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    line-height: 1.4;
}
.mt-period-btn:hover {
    border-color: var(--mt-primary);
    color: var(--mt-primary);
}
.mt-period-btn.mt-period-active {
    background: var(--mt-primary) !important;
    color: #fff !important;
    border-color: var(--mt-primary) !important;
}

/* ============================================================
   MULTI-ACTIVITÉS — sélecteur pills dans le formulaire
   ============================================================ */
.mt-act-multi { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
.mt-act-opt {
    display: inline-flex; align-items: center;
    padding: 5px 12px; border-radius: 20px;
    border: 1.5px solid var(--mt-border);
    cursor: pointer; font-size: 12px; font-weight: 500;
    color: var(--mt-text); background: #fff;
    transition: background .15s, color .15s, border-color .15s;
    user-select: none; line-height: 1;
}
.mt-act-opt input[type=checkbox] { display: none; }
.mt-act-opt:has(input:checked) {
    background: var(--mt-primary);
    color: #fff;
    border-color: var(--mt-primary);
}
.mt-act-badge {
    display: inline-block;
    padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: rgba(37,99,235,.10);
    color: var(--mt-primary);
    border: 1px solid rgba(37,99,235,.20);
    margin: 1px 2px;
    white-space: nowrap;
}

/* ============================================================
   OVERRIDE THÈME WORDPRESS — isolation styles
   ============================================================ */
.mt-app h1,.mt-app h2,.mt-app h3,.mt-app h4 { font-family: var(--mt-font); }
.mt-app a { color: var(--mt-primary); }
.mt-app img { max-width: 100%; }
.mt-app button { font-family: var(--mt-font); }
