/* ============================================================
   CRM NuptiaLogos — Design system
   Fondations reprises du design system NuptiaLogos v2 (tokens,
   primitives np-*), déclinées avec la charte CRM :
   bleu nuit (#193141) + accent terracotta (#B4552D).
   Bootstrap 5.3 en base utilitaire, surchargé sous .np-app-body.
   ============================================================ */

/* ── Échelle z-index unifiée (alignée Bootstrap 5) ── */
:root {
    --z-behind:             -1;     /* fond, aurora */
    --z-base:                0;
    --z-raised:              2;
    --z-sticky-local:       10;
    --z-floating-local:     50;
    --z-dropdown:         1000;
    --z-sticky:           1020;
    --z-fixed:            1030;
    --z-offcanvas-bd:     1040;
    --z-offcanvas:        1045;
    --z-modal-backdrop:   1050;
    --z-modal:            1055;
    --z-popover:          1070;
    --z-tooltip:          1080;
    --z-toast:            1090;
    --z-lightbox:         1100;
}

/* ── Tokens MASTER — palette CRM ── */
:root {
    /* Marque : bleu nuit NuptiaLogos */
    --brand:            #193141;
    --brand-700:        #122639;
    --brand-600:        #163A56;
    --brand-500:        #193141;
    --brand-400:        #2B4F78;
    --brand-100:        #E3E9F1;
    --brand-50:         #F4F6FB;
    --brand-on:         #FFFFFF;

    /* Accent CRM : terracotta */
    --secondary:        #B4552D;
    --secondary-700:    #8F4223;
    --secondary-500:    #B4552D;
    --secondary-100:    #F3E0D7;
    --secondary-50:     #FAF1EC;

    /* Surfaces */
    --bg:               #F6F8FB;
    --surface:          #FFFFFF;
    --surface-2:        #F9FBFD;
    --surface-hover:    #F2F4F8;

    /* Texte */
    --text:             #19283A;
    --text-muted:       #5C667B;
    --text-subtle:      #8C95AB;
    --text-on-brand:    #FFFFFF;

    /* Bordures */
    --border:           #E4E8EF;
    --border-strong:    #C3CBD8;
    --border-focus:     var(--brand);

    /* Sémantique */
    --success:          #1E8E5E;
    --success-bg:       #E6F4EE;
    --warning:          #B6791E;
    --warning-bg:       #FBF1DD;
    --danger:           #C0334A;
    --danger-bg:        #F8E2E6;
    --info:             #1E5FA0;
    --info-bg:          #E2EBF6;

    /* Focus ring */
    --ring:             rgba(25, 49, 65, 0.32);

    /* Radius */
    --radius-xs:        4px;
    --radius-sm:        6px;
    --radius-md:        10px;
    --radius-lg:        14px;
    --radius-xl:        20px;
    --radius-pill:      999px;

    /* Animation */
    --ease:             cubic-bezier(0.2, 0.8, 0.2, 1);
    --dur-fast:         120ms;
    --dur:              200ms;
    --dur-slow:         320ms;

    /* Espacements (rythme 4/8) */
    --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
    --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
    --space-12: 48px; --space-16: 64px; --space-20: 80px;

    /* Typo */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fs-12: 0.75rem;
    --fs-14: 0.875rem;
    --fs-16: 1rem;
    --fs-18: 1.125rem;
    --fs-20: 1.25rem;
    --fs-24: 1.5rem;
    --fs-32: 2rem;
    --fs-40: 2.5rem;
    --lh-tight: 1.2;
    --lh-base:  1.55;

    /* Display font — Fraunces variable */
    --font-display: 'Fraunces', 'Cormorant Garamond', 'Times New Roman', serif;
    --font-display-features: "ss01" 1, "ss02" 1, "ss03" 1;
    --tracking-display: -0.02em;
    --tracking-eyebrow: 0.16em;
    --tracking-tight:   -0.01em;
    --lh-display: 1.05;

    /* Spring easings */
    --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out-soft:  cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-soft:   cubic-bezier(0.55, 0, 0.55, 0.2);

    /* Shadow stack */
    --shadow-xs:  0 1px 2px rgba(15, 21, 48, 0.04), 0 1px 1px rgba(15, 21, 48, 0.03);
    --shadow-sm:  0 2px 8px rgba(15, 21, 48, 0.05), 0 1px 2px rgba(15, 21, 48, 0.04);
    --shadow-md:  0 8px 24px rgba(15, 21, 48, 0.07), 0 2px 6px rgba(15, 21, 48, 0.04);
    --shadow-lg:  0 20px 48px rgba(15, 21, 48, 0.10), 0 6px 16px rgba(15, 21, 48, 0.06);
    --shadow-xl:  0 32px 80px rgba(15, 21, 48, 0.14), 0 10px 24px rgba(15, 21, 48, 0.08);
    --shadow-ring: 0 0 0 1px var(--border);
    --glow-brand: 0 0 0 4px rgba(25, 49, 65, 0.06);

    /* Background aurora — teinté terracotta discret */
    --aurora-1: rgba(25, 49, 65, 0.045);
    --aurora-2: rgba(180, 85, 45, 0.07);
    --aurora-3: rgba(30, 95, 160, 0.035);

    /* Surface translucide navbar */
    --surface-glass: rgba(255, 255, 255, 0.78);
    --border-glass:  rgba(15, 21, 48, 0.06);
}

::selection {
    background: var(--brand);
    color: #FFFFFF;
}

/* ── Fond de page + aurora ── */
body.np-app-body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: var(--lh-base);
}
.np-bg-aurora {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: var(--z-behind);
    background:
        radial-gradient(60% 50% at 12% 8%,  var(--aurora-1) 0%, transparent 60%),
        radial-gradient(50% 40% at 88% 18%, var(--aurora-2) 0%, transparent 65%),
        radial-gradient(70% 60% at 50% 100%,var(--aurora-3) 0%, transparent 60%);
}
.np-bg-aurora::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.045 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    opacity: 0.6;
    mix-blend-mode: multiply;
}
.np-app-body { position: relative; }
/* Anti-piège modales Bootstrap : aucun contexte d'empilement < 1050 sur les
   ancêtres de .modal (pas de z-index/transform permanent sur main/footer). */
.np-app-body > main,
.np-app-body > footer { position: relative; }
.np-app-body > .navbar { z-index: var(--z-sticky); }

/* ── Typographie display ── */
.np-app-body h1,
.np-app-body h2,
.np-app-body h3,
.np-app-body .np-display {
    font-family: var(--font-display);
    font-feature-settings: var(--font-display-features);
    letter-spacing: var(--tracking-display);
    line-height: var(--lh-display);
    font-variation-settings: "opsz" 60, "SOFT" 30, "WONK" 0;
    font-weight: 500;
    color: var(--text);
}
.np-app-body h1 { font-variation-settings: "opsz" 96, "SOFT" 40, "WONK" 0; }
.np-app-body h3 { font-variation-settings: "opsz" 36, "SOFT" 20, "WONK" 0; font-weight: 600; }
.np-app-body h4, .np-app-body h5, .np-app-body h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: var(--tracking-tight);
    color: var(--text);
}

.np-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
}
.np-eyebrow::before {
    content: "";
    width: 24px; height: 1px;
    background: currentColor;
    opacity: 0.5;
}

.np-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    padding-bottom: var(--space-6);
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--border);
}
.np-page-header__title {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 96, "SOFT" 40;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 6px 0 0;
    color: var(--text);
}
.np-page-header__subtitle {
    color: var(--text-muted);
    font-size: var(--fs-16);
    margin: 6px 0 0;
}

.np-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-subtle);
    font-size: var(--fs-12);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    margin: var(--space-6) 0 var(--space-4);
}
.np-divider::before,
.np-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

/* ── Navbar : translucide + backdrop-blur ── */
.np-navbar {
    background: var(--surface-glass) !important;
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 1px 0 rgba(15, 21, 48, 0.02);
    transition: background var(--dur) var(--ease-out-soft),
                border-color var(--dur) var(--ease-out-soft);
    min-height: 64px;
}
.np-navbar .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-variation-settings: "opsz" 36, "SOFT" 20;
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--brand) !important;
}
.np-brand-mark {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--secondary) 130%);
    color: var(--brand-on);
    font-size: 14px;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.15);
}
.np-brand-name {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 36, "SOFT" 20;
    letter-spacing: -0.01em;
}
.np-navbar .nav-link {
    position: relative;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.92rem;
    padding: 10px 14px !important;
    border-radius: var(--radius-md);
    white-space: nowrap;
    transition: color var(--dur) var(--ease-out-soft),
                background var(--dur) var(--ease-out-soft);
}
.np-navbar .nav-link:hover {
    color: var(--brand);
    background: var(--surface-hover);
}
.np-navbar .nav-link.active {
    color: var(--brand);
    background: var(--brand-50);
}
.np-navbar .nav-link.active::after {
    content: "";
    position: absolute;
    left: 14px; right: 14px; bottom: 4px;
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
    transform-origin: center;
    animation: np-underline 320ms var(--ease-out-soft);
}
@keyframes np-underline {
    from { transform: scaleX(0); opacity: 0; }
    to   { transform: scaleX(1); opacity: 1; }
}
.np-navbar .navbar-toggler { border-color: var(--border); }
.np-navbar .navbar-toggler:focus { box-shadow: 0 0 0 3px var(--ring); }

/* ── Cards ── */
.np-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-xs);
    transition: transform var(--dur) var(--ease-out-soft),
                box-shadow var(--dur) var(--ease-out-soft),
                border-color var(--dur) var(--ease-out-soft);
}
.np-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.np-card.is-interactive { cursor: pointer; }
.np-card.is-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-100);
}
.np-card.is-interactive:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
    transition-duration: 80ms;
}
.np-app-body .card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--dur) var(--ease-out-soft),
                border-color var(--dur) var(--ease-out-soft);
}
.np-app-body .card:hover { box-shadow: var(--shadow-sm); }
.np-app-body .card-header-accent {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-500) 100%);
    color: var(--brand-on);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    padding: 14px 20px;
    font-family: var(--font-sans);
    font-weight: 600;
    letter-spacing: 0.01em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* ── Boutons ── */
.np-app-body .btn {
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: var(--radius-md);
    transition: transform 120ms var(--ease-spring),
                box-shadow var(--dur) var(--ease-out-soft),
                background var(--dur) var(--ease-out-soft),
                color var(--dur) var(--ease-out-soft),
                border-color var(--dur) var(--ease-out-soft);
}
.np-app-body .btn:active:not(:disabled) {
    transform: scale(0.97);
    transition-duration: 60ms;
}
.np-app-body .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ring);
}
.np-app-body .btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-on);
    box-shadow: 0 1px 2px rgba(25, 49, 65, 0.20), inset 0 1px 0 rgba(255,255,255,0.12);
}
.np-app-body .btn-primary:hover:not(:disabled) {
    background: var(--brand-700);
    border-color: var(--brand-700);
    box-shadow: 0 4px 12px rgba(25, 49, 65, 0.25), inset 0 1px 0 rgba(255,255,255,0.12);
}
.np-app-body .btn-accent {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(180, 85, 45, 0.25), inset 0 1px 0 rgba(255,255,255,0.15);
}
.np-app-body .btn-accent:hover:not(:disabled) {
    background: var(--secondary-700);
    border-color: var(--secondary-700);
    color: #fff;
}
.np-app-body .btn-outline-primary {
    color: var(--brand);
    border-color: var(--border-strong);
    background: var(--surface);
}
.np-app-body .btn-outline-primary:hover:not(:disabled) {
    background: var(--brand-50);
    border-color: var(--brand);
    color: var(--brand-700);
}
.np-app-body .btn-outline-secondary {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface);
}
.np-app-body .btn-outline-secondary:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--text-subtle);
    color: var(--text);
}
.np-app-body .btn-link {
    color: var(--brand);
    text-decoration: none;
}
.np-app-body .btn-link:hover {
    color: var(--brand-700);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Formulaires ── */
.np-app-body .form-control,
.np-app-body .form-select {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text);
    padding: 10px 14px;
    font-size: var(--fs-16);
    transition: border-color var(--dur) var(--ease-out-soft),
                box-shadow var(--dur) var(--ease-out-soft);
}
.np-app-body .form-control-sm,
.np-app-body .form-select-sm {
    padding: 6px 10px;
    font-size: var(--fs-14);
}
.np-app-body .form-control:hover:not(:focus):not(:disabled),
.np-app-body .form-select:hover:not(:focus):not(:disabled) {
    border-color: var(--text-subtle);
}
.np-app-body .form-control:focus,
.np-app-body .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--ring);
}
.np-app-body .form-label {
    font-size: var(--fs-14);
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.np-app-body .form-text {
    font-size: var(--fs-12);
    color: var(--text-muted);
}
.np-app-body .form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}
.np-app-body fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}
.np-app-body fieldset legend {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 36, "SOFT" 20;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--brand);
    padding: 0 8px;
    letter-spacing: var(--tracking-tight);
    float: none;
    width: auto;
}

/* ── Tables ── */
.np-app-body .table {
    --bs-table-bg: var(--surface);
    border-color: var(--border);
}
.np-app-body .table thead th {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-700) 100%);
    color: var(--brand-on);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: var(--fs-12);
    text-transform: uppercase;
    letter-spacing: var(--tracking-eyebrow);
    padding: 12px 16px;
    border: none;
    white-space: nowrap;
}
.np-app-body .table thead th a {
    color: inherit;
    text-decoration: none;
}
.np-app-body .table thead th a:hover { opacity: 0.85; }
.np-app-body .table tbody td {
    padding: 10px 16px;
    vertical-align: middle;
}
.np-app-body .table tbody tr {
    transition: background var(--dur) var(--ease-out-soft);
}
.np-app-body .table tbody tr:hover { background: var(--surface-hover); }

/* Table responsive → cartes en mobile (pattern v2 _action_table) */
@media (max-width: 767.98px) {
    .np-responsive-table thead { display: none; }
    .np-responsive-table tbody tr {
        display: block;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-xs);
        margin-bottom: var(--space-3);
        padding: var(--space-3) var(--space-4);
    }
    .np-responsive-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: var(--space-3);
        border: none;
        padding: 4px 0;
    }
    .np-responsive-table tbody td[data-label]::before {
        content: attr(data-label);
        font-size: var(--fs-12);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: var(--tracking-eyebrow);
        color: var(--text-subtle);
        flex-shrink: 0;
    }
}

/* ── Alerts ── */
.np-app-body .alert {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    padding: 14px 18px;
}
.np-app-body .alert-success { background: var(--success-bg); border-color: rgba(30,142,94,0.20); color: var(--success); }
.np-app-body .alert-warning { background: var(--warning-bg); border-color: rgba(182,121,30,0.20); color: var(--warning); }
.np-app-body .alert-danger  { background: var(--danger-bg);  border-color: rgba(192,51,74,0.20);  color: var(--danger); }
.np-app-body .alert-info    { background: var(--info-bg);    border-color: rgba(30,95,160,0.20);  color: var(--info); }

/* ── Badges ── */
.np-app-body .badge {
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: var(--radius-pill);
    padding: 4px 10px;
}
.np-badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-12);
    font-weight: 600;
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    white-space: nowrap;
}
.np-badge-soft.is-secondary { background: var(--surface-hover); color: var(--text-muted); }
.np-badge-soft.is-info      { background: var(--info-bg);       color: var(--info); }
.np-badge-soft.is-success   { background: var(--success-bg);    color: var(--success); }
.np-badge-soft.is-warning   { background: var(--warning-bg);    color: var(--warning); }
.np-badge-soft.is-danger    { background: var(--danger-bg);     color: var(--danger); }
.np-badge-soft.is-brand     { background: var(--brand-100);     color: var(--brand); }
.np-badge-soft.is-accent    { background: var(--secondary-100); color: var(--secondary-700); }

/* Avatar trigramme */
.np-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.np-avatar.is-sm { width: 22px; height: 22px; font-size: 9px; }

/* ── Modals ── */
.np-app-body .modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}
.np-app-body .modal-header {
    border-bottom: 1px solid var(--border);
    padding: 18px 22px;
}
.np-app-body .modal-title {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 48, "SOFT" 30;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.np-app-body .modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; }
.np-app-body .modal-backdrop { z-index: 1050 !important; }
.np-app-body .modal          { z-index: 1055 !important; }
.np-app-body .modal-backdrop.show { opacity: 0.45; }
.np-app-body.modal-open > main {
    transform: none !important;
    filter: none !important;
    animation: none !important;
    opacity: 1 !important;
}
body > .modal-backdrop ~ .modal-backdrop { z-index: 1051 !important; }
body > .modal-backdrop:not(.show) { display: none !important; }

/* ── Dropdowns ── */
.np-app-body .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    background: var(--surface);
    animation: np-dropdown-in 200ms var(--ease-out-soft);
}
@keyframes np-dropdown-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.np-app-body .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text);
    font-size: var(--fs-14);
    transition: background var(--dur) var(--ease-out-soft);
}
.np-app-body .dropdown-item:hover,
.np-app-body .dropdown-item:focus {
    background: var(--surface-hover);
    color: var(--brand);
}

/* ── Pagination ── */
.np-app-body .pagination .page-link {
    color: var(--text-muted);
    border-color: var(--border);
    border-radius: var(--radius-sm);
    margin: 0 2px;
    transition: all var(--dur) var(--ease-out-soft);
}
.np-app-body .pagination .page-link:hover {
    color: var(--brand);
    background: var(--surface-hover);
}
.np-app-body .pagination .page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-on);
}
.np-app-body .pagination .page-item.disabled .page-link { color: var(--text-subtle); }

/* ── Liens ── */
.np-app-body a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.badge) {
    color: var(--brand-400);
    text-decoration: none;
}
.np-app-body a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.badge):hover {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Footer ── */
.np-app-body footer {
    background: transparent;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* ── Animations de page ── */
.np-main { animation: np-main-in 420ms var(--ease-out-soft) both; }
@keyframes np-main-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.np-stagger > * { opacity: 0; animation: np-stagger-in 480ms var(--ease-out-soft) forwards; }
.np-stagger > *:nth-child(1) { animation-delay: 40ms; }
.np-stagger > *:nth-child(2) { animation-delay: 80ms; }
.np-stagger > *:nth-child(3) { animation-delay: 120ms; }
.np-stagger > *:nth-child(4) { animation-delay: 160ms; }
.np-stagger > *:nth-child(5) { animation-delay: 200ms; }
.np-stagger > *:nth-child(6) { animation-delay: 240ms; }
.np-stagger > *:nth-child(7) { animation-delay: 280ms; }
.np-stagger > *:nth-child(8) { animation-delay: 320ms; }
.np-stagger > *:nth-child(n+9) { animation-delay: 360ms; }
@keyframes np-stagger-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .np-main,
    .np-stagger > *,
    .np-app-body .dropdown-menu { animation: none !important; opacity: 1 !important; }
}

/* ── Empty state ── */
.np-empty {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-muted);
}
.np-empty i {
    font-size: 2.5rem;
    color: var(--text-subtle);
    display: block;
    margin-bottom: var(--space-3);
}

/* ============================================================
   Composants spécifiques CRM
   ============================================================ */

/* ── Barre de filtres ── */
.crm-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-2) var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
}
.crm-filter-bar .form-label {
    font-size: var(--fs-12);
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}
.crm-filter-bar .form-select,
.crm-filter-bar .form-control {
    min-width: 130px;
}

/* ── Stat cards dashboard ── */
.crm-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    padding: var(--space-4) var(--space-5);
    height: 100%;
    transition: box-shadow var(--dur) var(--ease-out-soft), border-color var(--dur) var(--ease-out-soft);
}
.crm-stat:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.crm-stat__label {
    font-size: var(--fs-12);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-subtle);
    display: flex;
    align-items: center;
    gap: 6px;
}
.crm-stat__value {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 60, "SOFT" 30;
    font-size: var(--fs-32);
    font-weight: 500;
    line-height: 1.1;
    color: var(--text);
}
.crm-stat__hint { font-size: var(--fs-12); color: var(--text-muted); }
.crm-stat.is-danger .crm-stat__value { color: var(--danger); }
.crm-stat.is-success .crm-stat__value { color: var(--success); }
.crm-stat.is-accent .crm-stat__value { color: var(--secondary); }

/* ── Kanban ── */
.crm-kanban {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-4);
    align-items: flex-start;
    scroll-snap-type: x proximity;
}
.crm-kanban-col {
    flex: 0 0 292px;
    max-width: 292px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 240px);
}
.crm-kanban-col__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface-2);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: var(--z-raised);
}
.crm-kanban-col__title {
    font-size: var(--fs-14);
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.crm-kanban-col__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.crm-kanban-col__count {
    font-size: var(--fs-12);
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 1px 8px;
}
.crm-kanban-col__body {
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    overflow-y: auto;
    min-height: 60px;
    flex: 1;
}
.crm-kanban-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    padding: var(--space-3);
    cursor: grab;
    transition: box-shadow var(--dur) var(--ease-out-soft),
                border-color var(--dur) var(--ease-out-soft);
}
.crm-kanban-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.crm-kanban-card.sortable-ghost {
    opacity: 0.4;
    border-style: dashed;
    border-color: var(--brand-400);
}
.crm-kanban-card.sortable-drag { cursor: grabbing; box-shadow: var(--shadow-lg); }
.crm-kanban-card__title {
    font-weight: 600;
    font-size: var(--fs-14);
    color: var(--text);
    margin-bottom: 2px;
    display: block;
}
.crm-kanban-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-12);
    color: var(--text-muted);
    margin-top: 6px;
}
.crm-kanban-col__more {
    display: block;
    text-align: center;
    font-size: var(--fs-12);
    padding: var(--space-2);
    color: var(--text-muted);
}

/* ── Timeline d'actions (fiche organisation) ── */
.crm-timeline {
    position: relative;
    padding-left: 34px;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.crm-timeline::before {
    content: "";
    position: absolute;
    left: 13px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
}
.crm-timeline__item { position: relative; }
.crm-timeline__icon {
    position: absolute;
    left: -34px; top: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-100);
    color: var(--brand);
    font-size: 13px;
    border: 2px solid var(--surface);
    box-shadow: var(--shadow-xs);
}
.crm-timeline__item.is-mail .crm-timeline__icon    { background: var(--info-bg); color: var(--info); }
.crm-timeline__item.is-appel .crm-timeline__icon   { background: var(--success-bg); color: var(--success); }
.crm-timeline__item.is-rdv .crm-timeline__icon     { background: var(--secondary-100); color: var(--secondary-700); }
.crm-timeline__item.is-relance .crm-timeline__icon { background: var(--warning-bg); color: var(--warning); }
.crm-timeline__item.is-note .crm-timeline__icon    { background: var(--surface-hover); color: var(--text-muted); }
.crm-timeline__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    padding: var(--space-3) var(--space-4);
}
.crm-timeline__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: 2px;
}
.crm-timeline__date { font-size: var(--fs-12); color: var(--text-subtle); white-space: nowrap; }

/* ── Rappel en retard ── */
.crm-overdue { color: var(--danger); font-weight: 600; }

/* ── Prévisualisation email ── */
.crm-mail-preview__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.crm-mail-preview__subject {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    min-height: 34px;
}

/* ── Éditeur HTML (mode code) ── */
.crm-code-editor {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: var(--fs-14);
    line-height: 1.5;
    background: #FBFBFC;
    tab-size: 2;
    white-space: pre;
}

/* ── Login ── */
.crm-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}
.crm-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--space-10) var(--space-8);
}
