/* ═══════════════════════════════════════════════════════════
   MYLIVRAISON — DESIGN SYSTEM (épuré / soft / moderne)
   Palette : noir + orange
   ═══════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* L'attribut `hidden` l'emporte toujours, même sur un `display` de classe
   (ex. `.form-row { display: grid }`). */
[hidden] {
    display: none !important;
}

:root {
    --black: #111111;
    --black-soft: #1c1c1c;
    --orange: #ff6b00;
    --orange-dark: #e05f00;
    --orange-soft: rgba(255, 107, 0, .08);
    --orange-glow: rgba(255, 107, 0, .18);

    --sidebar-w: 250px;
    --header-h: 64px;

    --bg: #fafafa;
    --white: #ffffff;
    --text: #171717;
    --text-muted: #767676;
    --border: #ececec;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .04);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, .06);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --transition: .18s ease;
}

html,
body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

button {
    font-family: inherit;
}

/* ═══════════════════════════════════════
   LAYOUT SHELL
═══════════════════════════════════════ */
#ml-app {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.ml-sidebar {
    width: var(--sidebar-w);
    background: var(--black);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.ml-sidebar-logo {
    padding: 0 22px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ml-logo-mark-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--white);
}

.ml-logo-text strong {
    display: block;
    font-size: .95rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1.15;
}

.ml-logo-text span {
    font-size: .68rem;
    color: rgba(255, 255, 255, .45);
}

.ml-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 14px 10px;
}

.ml-nav-label {
    font-size: .64rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .35);
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 0 12px;
    margin: 18px 0 6px;
}

.ml-nav-label:first-child {
    margin-top: 4px;
}

.ml-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .65);
    font-size: .85rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    margin-bottom: 2px;
    position: relative;
}

.ml-nav-item svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.ml-nav-item:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--white);
}

.ml-nav-item.active {
    background: var(--orange);
    color: var(--black);
    font-weight: 600;
}

.ml-nav-badge {
    margin-left: auto;
    background: var(--orange);
    color: var(--black);
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 100px;
    min-width: 18px;
    text-align: center;
}

.ml-nav-item.active .ml-nav-badge {
    background: var(--black);
    color: var(--orange);
}

.ml-sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.ml-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.ml-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .74rem;
    font-weight: 700;
    color: var(--black);
    flex-shrink: 0;
}

.ml-user-info strong {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1.2;
}

.ml-user-info span {
    font-size: .7rem;
    color: rgba(255, 255, 255, .45);
    text-transform: capitalize;
}

.ml-btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: none;
    background: none;
    color: rgba(255, 255, 255, .55);
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.ml-btn-logout svg {
    width: 15px;
    height: 15px;
}

.ml-btn-logout:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--white);
}

/* ── MAIN AREA ── */
.ml-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ml-topbar {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.ml-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ml-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text);
}

.ml-page-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.ml-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ml-topbar-date {
    font-size: .78rem;
    color: var(--text-muted);
}

.ml-topbar-clock {
    font-size: .78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.ml-page-content {
    flex: 1;
    padding: 26px;
    max-width: 1400px;
    width: 100%;
}

.ml-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 14px;
}

.ml-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.ml-subheading {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ═══════════════════════════════════════
   ALERTS / FLASH
═══════════════════════════════════════ */
.ml-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: ml-slide-in .25s ease;
}

.ml-alert svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ml-alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: .6;
    font-size: .9rem;
}

.ml-alert-close:hover {
    opacity: 1;
}

.ml-alert-success {
    background: #f0fdf4;
    color: #15803d;
}

.ml-alert-error {
    background: #fef2f2;
    color: #b91c1c;
}

.ml-alert-warning {
    background: #fffbeb;
    color: #b45309;
}

.ml-alert-info {
    background: #f4f4f5;
    color: #3f3f46;
}

@keyframes ml-slide-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════
   UTILITIES : BOUTONS
═══════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn svg {
    width: 15px;
    height: 15px;
}

.btn-primary {
    background: var(--orange);
    color: var(--black);
}

.btn-primary:hover {
    background: var(--orange-dark);
    color: var(--white);
}

.btn-dark {
    background: var(--black);
    color: var(--white);
}

.btn-dark:hover {
    background: var(--black-soft);
}

.btn-outline {
    background: var(--white);
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--black);
}

.btn-danger-outline {
    background: var(--white);
    color: #b91c1c;
    border-color: #fecaca;
}

.btn-danger-outline:hover {
    background: #fef2f2;
}

.btn-sm {
    padding: 6px 13px;
    font-size: .78rem;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════
   CARDS / TABLEAUX / BADGES / FORMS
═══════════════════════════════════════ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.card-title {
    font-size: .9rem;
    font-weight: 600;
}

.card-body {
    padding: 20px;
    overflow-x: auto;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}

.stat-card .stat-label {
    font-size: .76rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.stat-card.stat-accent .stat-value {
    color: var(--orange);
}

/* Carte cliquable (tableau de bord) : ouvre le détail correspondant. */
a.stat-card.stat-link {
    display: block;
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

a.stat-card.stat-link::after {
    content: '→';
    position: absolute;
    top: 16px;
    right: 18px;
    color: var(--text-muted);
    font-size: .9rem;
    opacity: 0;
    transition: opacity var(--transition), transform var(--transition);
}

a.stat-card.stat-link:hover,
a.stat-card.stat-link:focus-visible {
    border-color: var(--orange);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    outline: none;
}

a.stat-card.stat-link:hover::after,
a.stat-card.stat-link:focus-visible::after {
    opacity: 1;
    color: var(--orange);
    transform: translateX(2px);
}

.stat-card .stat-hint {
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 600;
}

.badge-orange {
    background: var(--orange-soft);
    color: var(--orange-dark);
}

.badge-black {
    background: #f2f2f2;
    color: var(--black);
}

.badge-green {
    background: #f0fdf4;
    color: #16a34a;
}

.badge-red {
    background: #fef2f2;
    color: #b91c1c;
}

.badge-gray {
    background: #f4f4f4;
    color: #6b7280;
}

table.ml-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}

.ml-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    border-bottom: 1px solid var(--border);
}

.ml-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.ml-table tbody tr:hover {
    background: #fafafa;
}

.ml-table tbody tr:last-child td {
    border-bottom: none;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .86rem;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: border-color var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--orange);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-error {
    color: #b91c1c;
    font-size: .76rem;
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ═══════════════════════════════════════
   MISE EN PAGE À DEUX COLONNES — s'empile
   automatiquement sur tablette / mobile
═══════════════════════════════════════ */
.ml-split,
.ml-split-main {
    display: grid;
    gap: 20px;
    align-items: start;
}

.ml-split {
    grid-template-columns: 1fr 1fr;
}

.ml-split-main {
    grid-template-columns: 2fr 1fr;
}

/* ═══════════════════════════════════════
   AUTH / LOGIN
═══════════════════════════════════════ */
.ml-auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
    padding: 20px;
}

.ml-auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-md);
}

.ml-auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.ml-auth-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.ml-auth-subtitle {
    font-size: .84rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.ml-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

/* ═══════════════════════════════════════
   AUTOCOMPLETE (recherche client rapide)
═══════════════════════════════════════ */
.ml-autocomplete-wrap {
    position: relative;
}

.ml-autocomplete-results {
    position: absolute;
    z-index: 60;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 240px;
    overflow-y: auto;
}

.ml-autocomplete-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-align: left;
    font-size: .84rem;
}

.ml-autocomplete-item:last-child {
    border-bottom: none;
}

.ml-autocomplete-item:hover,
.ml-autocomplete-item.is-active {
    background: var(--bg);
}

.ml-autocomplete-item span {
    font-size: .76rem;
    color: var(--text-muted);
}

.ml-autocomplete-empty {
    padding: 10px 12px;
    font-size: .8rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   TIMELINE (historique statut course)
═══════════════════════════════════════ */
.ml-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ml-timeline-item {
    display: flex;
    gap: 12px;
    padding-bottom: 18px;
    position: relative;
}

.ml-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 14px;
    bottom: 0;
    width: 1.5px;
    background: var(--border);
}

.ml-timeline-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--orange);
    margin-top: 4px;
    flex-shrink: 0;
}

.ml-timeline-content strong {
    display: block;
    font-size: .85rem;
}

.ml-timeline-content span {
    font-size: .76rem;
    color: var(--text-muted);
}

/* ── MOBILE ── */
.ml-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 99;
}

.ml-sidebar-overlay.active {
    display: block;
}

@media (max-width: 900px) {
    .ml-sidebar {
        transform: translateX(-100%);
    }

    .ml-sidebar.open {
        transform: translateX(0);
    }

    .ml-main {
        margin-left: 0;
    }

    .ml-menu-toggle {
        display: block;
    }

    .ml-page-content {
        padding: 18px 14px;
    }

    .ml-topbar {
        padding: 0 14px;
    }

    .ml-topbar-date {
        display: none;
    }

    .ml-fab {
        right: 18px;
        bottom: 18px;
    }

    .ml-split,
    .ml-split-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ml-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .ml-page-header > .btn,
    .ml-page-header > a.btn {
        width: 100%;
    }

    .card-header form[style*="display:flex"],
    .card-header div[style*="display:flex"],
    .ml-page-header form[style*="display:flex"] {
        width: 100%;
        flex-wrap: wrap;
    }

    .card-header form[style*="display:flex"] .form-control,
    .ml-page-header form[style*="display:flex"] .form-control {
        max-width: none !important;
        width: 100%;
        flex: 1 1 130px;
    }
}

/* ═══════════════════════════════════════
   BOUTON FLOTTANT — course rapide
═══════════════════════════════════════ */
.ml-fab {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 200;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--orange);
    color: var(--black);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px var(--orange-glow), 0 2px 6px rgba(0, 0, 0, .12);
    transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease, background .2s ease;
}

.ml-fab svg {
    width: 26px;
    height: 26px;
    transition: transform .25s ease;
}

.ml-fab:hover {
    background: var(--orange-dark);
    color: var(--white);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px var(--orange-glow), 0 4px 10px rgba(0, 0, 0, .16);
}

.ml-fab:active {
    transform: translateY(-1px) scale(.98);
}

.ml-fab.is-open svg {
    transform: rotate(45deg);
}

.ml-fab-label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: var(--black);
    color: var(--white);
    font-size: .78rem;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 100px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.ml-fab:hover .ml-fab-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ═══════════════════════════════════════
   MODALE — course rapide
═══════════════════════════════════════ */
.ml-modal-backdrop {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    background: rgba(17, 17, 17, .5);
    backdrop-filter: blur(2px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.ml-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.ml-modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: min(720px, 92vh);
    max-height: min(720px, 92dvh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
    transform: translateY(16px) scale(.98);
    opacity: 0;
    transition: transform .22s cubic-bezier(.16, 1, .3, 1), opacity .22s ease;
}

.ml-modal-backdrop.is-open .ml-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.ml-modal > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.ml-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.ml-modal-header-text strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
}

.ml-modal-header-text span {
    font-size: .78rem;
    color: var(--text-muted);
}

.ml-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}

.ml-modal-close:hover {
    background: var(--orange-soft);
    color: var(--orange-dark);
}

.ml-modal-close svg {
    width: 16px;
    height: 16px;
}

.ml-modal-body {
    padding: 22px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0;
}

.ml-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.ml-modal .form-error-text {
    color: #b91c1c;
    font-size: .76rem;
    margin-top: 4px;
    display: none;
}

.ml-modal .form-control.is-invalid {
    border-color: #b91c1c;
}

.ml-modal .form-control.is-invalid+.form-error-text,
.ml-modal .ml-autocomplete-wrap .is-invalid~.form-error-text {
    display: block;
}

/* État de succès (course créée) */
.ml-modal-success {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 36px 24px;
    gap: 14px;
}

.ml-modal-success.is-visible {
    display: flex;
}

.ml-modal-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0fdf4;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ml-pop .35s cubic-bezier(.34, 1.56, .64, 1);
}

.ml-modal-success-icon svg {
    width: 30px;
    height: 30px;
}

@keyframes ml-pop {
    from {
        transform: scale(.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.ml-modal-success strong {
    font-size: 1.05rem;
}

.ml-modal-success span {
    font-size: .84rem;
    color: var(--text-muted);
}

.ml-modal-success-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.ml-btn-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, .25);
    border-top-color: var(--black);
    animation: ml-spin .6s linear infinite;
    display: none;
}

.btn-primary .ml-btn-spinner {
    border-top-color: var(--black);
}

.is-loading .ml-btn-spinner {
    display: inline-block;
}

.is-loading .ml-btn-label {
    opacity: .7;
}

@keyframes ml-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 480px) {
    .ml-modal {
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .ml-modal-backdrop {
        padding: 0;
    }
}

/* ── Select avec recherche (ML.initSearchableSelect) ── */
.ml-select {
    position: relative;
}

.ml-select > select {
    /* Reste dans le formulaire (valeur envoyée, bulle « required »)
       mais invisible sous le déclencheur. */
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.ml-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    cursor: pointer;
}

.ml-select-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ml-select-trigger svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.ml-select-panel {
    padding: 0;
    max-height: none;
    overflow: hidden;
}

.ml-select-panel .ml-select-search {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    font: inherit;
    font-size: .84rem;
    outline: none;
}

.ml-select-list {
    max-height: 240px;
    overflow-y: auto;
}

.ml-select-list .ml-autocomplete-item.is-active {
    background: var(--bg);
}

.ml-select-list .ml-autocomplete-item.is-selected {
    font-weight: 600;
    color: var(--orange);
}

.ml-select-empty {
    padding: 10px 12px;
    font-size: .82rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   CLOCHE DE NOTIFICATIONS (en-tête)
═══════════════════════════════════════ */
.ml-bell {
    position: relative;
}

.ml-bell-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    cursor: pointer;
}

.ml-bell-btn:hover {
    border-color: var(--orange);
}

.ml-bell-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--orange);
    color: var(--black);
    font-size: .68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ml-bell-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 340px;
    max-width: calc(100vw - 32px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 150;
}

.ml-bell-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.ml-bell-link {
    background: none;
    border: none;
    color: var(--orange-dark);
    font: inherit;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
}

.ml-bell-list {
    max-height: 360px;
    overflow-y: auto;
}

.ml-bell-item {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
}

.ml-bell-item:hover {
    background: var(--bg);
}

.ml-bell-item.is-unread {
    background: var(--orange-soft);
}

.ml-bell-item strong {
    display: block;
}

.ml-bell-item span {
    display: block;
    color: var(--text-muted);
    font-size: .76rem;
    margin-top: 2px;
}

.ml-bell-empty {
    padding: 18px 14px;
    color: var(--text-muted);
    font-size: .82rem;
    text-align: center;
}

.ml-bell-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: .8rem;
    cursor: pointer;
}

@media (max-width: 600px) {
    .ml-bell-panel {
        position: fixed;
        top: 60px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
    }
}
