/* ============================================================
   mobile.css — Application mobile Taxi RDV
   Fichier indépendant de admin.css et style.css.
   Conçu pour une SPA légère sur téléphone : liste + détail.
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

/* Les champs de saisie doivent rester sélectionnables */
input, textarea, [contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f3ff;
    color: #1e293b;
    height: 100vh;      /* fallback pour navigateurs sans dvh (anciens Android/WebView) */
    height: 100dvh;     /* hauteur dynamique : ajuste quand la barre navigateur apparaît/disparaît */
    display: flex;
    flex-direction: column;
    overflow: hidden;   /* empêche le body de grandir au-delà du viewport */
}

/* ── Variables ────────────────────────────────────────────── */

:root {
    --mbl-header-h: 56px;
    --mbl-tabs-h:   48px;
    --safe-top:    env(safe-area-inset-top,    0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --urgent-color:   #dc2626;
    --en-cours-color: #9333ea;
    --today-color:    #c026d3;
    --week-color:     #8b5cf6;
    --confirm-color:  #16a34a;
    --refuse-color:   #dc2626;
    --start-color:    #9333ea;
    --done-color:     #16a34a;
    --attente-color:  #f59e0b;
    --modifie-color:  #a855f7;
}

/* ── En-tête ──────────────────────────────────────────────── */

.mbl-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    padding-top: var(--safe-top);
    height: calc(var(--mbl-header-h) + var(--safe-top));
    background: linear-gradient(135deg, #4c1d95 0%, #a21caf 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(76,29,149,.4);
}

.mbl-header__left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.mbl-header__right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mbl-header__title {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mbl-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    transition: background .15s;
}

.mbl-icon-btn:hover,
.mbl-icon-btn:active {
    background: rgba(255,255,255,.12);
}

/* Indicateur de synchronisation */

.mbl-sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    transition: background .3s;
    flex-shrink: 0;
}

.mbl-sync-dot--syncing {
    background: #f59e0b;
    animation: mbl-pulse 1s infinite;
}

.mbl-sync-dot--ok {
    background: #22c55e;
}

.mbl-sync-dot--error {
    background: #ef4444;
}

/* État hors-ligne : le point devient un label texte orange */
.mbl-sync-dot--offline {
    width: auto;
    height: auto;
    border-radius: 4px;
    background: #fff7ed;
    color: #c2410c;
    font-size: .6875rem;
    font-weight: 700;
    padding: 2px 6px;
    letter-spacing: .02em;
    animation: none;
}

/* Désactivation des boutons d'action en mode hors-ligne */
.mbl-offline .mbl-action-btn,
.mbl-offline .mbl-detail-actions .mbl-btn,
.mbl-offline [id^="btn-statut"],
.mbl-offline #btn-enregistre,
.mbl-offline #btn-edit-rdv,
.mbl-offline #btn-delete-rdv,
.mbl-offline #btn-archive {
    opacity: .35;
    pointer-events: none;
}

@keyframes mbl-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}

/* ── Corps principal ──────────────────────────────────────── */

.mbl-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* ── Vues (liste / détail) ────────────────────────────────── */

.mbl-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.mbl-view--hidden {
    display: none;
}

/* Animation slide-in depuis la droite */
.mbl-view--slide-in {
    animation: mbl-slide-in .2s ease-out;
}

.mbl-view--slide-out {
    animation: mbl-slide-out .2s ease-in;
}

@keyframes mbl-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}

@keyframes mbl-slide-out {
    from { transform: translateX(0);   opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* ── Bottom navigation ────────────────────────────────────── */

:root {
    --mbl-bottom-nav-h: 64px;
}

.mbl-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: stretch;
    background: #2e1065;
    border-top: none;
    box-shadow: 0 -4px 20px rgba(0,0,0,.3);
    padding-bottom: var(--safe-bottom);
    height: calc(var(--mbl-bottom-nav-h) + var(--safe-bottom));
}

.mbl-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,.38);
    font-size: .6875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    padding: 8px 4px;
    transition: color .15s, background .15s;
    -webkit-user-select: none;
    user-select: none;
}

.mbl-bottom-nav__item:active { opacity: .7; }

/* Pill active */
.mbl-bottom-nav__item--active::before { display: none; }

.mbl-bottom-nav__item--active,
.mbl-bottom-nav__item--urgent.mbl-bottom-nav__item--active,
.mbl-bottom-nav__item--en_cours.mbl-bottom-nav__item--active,
.mbl-bottom-nav__item--today.mbl-bottom-nav__item--active,
.mbl-bottom-nav__item--week.mbl-bottom-nav__item--active {
    color: #fff;
    background: rgba(255,255,255,.15);
    border-radius: 10px;
    margin: 4px 3px;
}

/* Badge compteur */
.mbl-bottom-nav__badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 18px);
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: #dc2626;
    color: #fff;
    font-size: .625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mbl-bottom-nav__badge:empty,
.mbl-bottom-nav__badge[data-count="0"] { display: none; }

/* Onglet Archives */
.mbl-bottom-nav__item--archive {
    color: inherit;
}

/* ── Listes ───────────────────────────────────────────────── */

.mbl-list-wrap {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 12px calc(var(--mbl-bottom-nav-h) + var(--safe-bottom) + 16px);
}

.mbl-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mbl-list--hidden { display: none; }

/* ── Carte RDV dans la liste ──────────────────────────────── */

.mbl-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    overflow: hidden;
    border-left: 4px solid var(--card-accent, #94a3b8);
    cursor: pointer;
    transition: box-shadow .15s, transform .1s;
    -webkit-user-select: none;
    user-select: none;
}

.mbl-card:active {
    transform: scale(.98);
    box-shadow: 0 0 0 rgba(0,0,0,0);
}

/* Fond vert révélé par le swipe-droite — masqué par défaut */
.mbl-card__reg-bg {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 90px;
    background: #16a34a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    gap: 5px;
    pointer-events: none;
    border-radius: 12px 0 0 12px;
    opacity: 0;
    transition: opacity .1s;
}

/* Fond rouge révélé par le swipe-gauche — masqué par défaut */
.mbl-card__del-bg {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 90px;
    background: #dc2626;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    gap: 5px;
    pointer-events: none;
    border-radius: 0 12px 12px 0;
    opacity: 0;
    transition: opacity .1s;
}

.mbl-card__inner {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    background: var(--card-bg, #fff);
    will-change: transform;
}

/* ── Avatar initiales dans la carte ──────────────────────── */

.mbl-card__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--card-accent, #94a3b8);
    color: #fff;
    font-size: .625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .03em;
}

/* ── Fonds colorés par statut ─────────────────────────────── */

[data-statut="attente"]  { --card-bg: #fffbeb; }
[data-statut="modifie"]  { --card-bg: #fdf4ff; }
[data-statut="confirme"] { --card-bg: #f0fdf4; }
[data-statut="en_cours"] { --card-bg: #faf5ff; }
[data-statut="effectue"] { --card-bg: #f0fdf4; }
[data-statut="archive"]  { --card-bg: #f8f9fa; }

.mbl-card__body {
    flex: 1;
    min-width: 0;
}

.mbl-card__name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9375rem;
    font-weight: 700;
    color: #1e293b;
    overflow: hidden;
}

.mbl-card__name > span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.mbl-card__meta {
    font-size: .8125rem;
    color: #64748b;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mbl-card__lieu {
    font-size: .8125rem;
    color: #475569;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mbl-card__pec {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 5px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: .75rem;
    font-weight: 600;
}

.mbl-card__badge {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    color: #fff;
}

/* Couleurs des badges par statut */
.mbl-card__badge--attente   { background: #f59e0b; }
.mbl-card__badge--modifie   { background: #a855f7; }
.mbl-card__badge--confirme  { background: #16a34a; }
.mbl-card__badge--en_cours  { background: #9333ea; }
.mbl-card__badge--effectue  { background: #6b7280; }
.mbl-card__badge--archive   { background: #9ca3af; }
.mbl-card__badge--annule_c  { background: #dc2626; }
.mbl-card__badge--annule_s  { background: #6b7280; }

/* Pastille "Enregistré" sur les cartes de liste */
.mbl-card__enrg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 5px;
    font-size: .625rem;
    font-weight: 700;
    padding: 2px 6px;
    white-space: nowrap;
    letter-spacing: .02em;
}

/* ── Besoins spéciaux (fiche détail) ────────────────────────────────────── */

.mbl-besoin-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-left: 24px;
}

.mbl-besoin-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: .8125rem;
    padding: 3px 10px;
    white-space: nowrap;
}

.mbl-besoin-note {
    margin: 0 0 0 24px;
    font-size: .8125rem;
    color: #64748b;
    font-style: italic;
}

/* Tag texte type transport — médical ou standard */
.mbl-card__transport {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: 20px;
    font-size: .6875rem;
    font-weight: 500;
    padding: 1px 7px;
    white-space: nowrap;
    vertical-align: middle;
}
.mbl-card__transport--medical  { background: #dbeafe; color: #1d4ed8; }
.mbl-card__transport--standard { background: #fed7aa; color: #c2410c; }

/* Bouton toggle "Enregistré" dans la fiche détail */
.mbl-enrg-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
    -webkit-tap-highlight-color: transparent;
}

.mbl-enrg-toggle--on {
    border-color: #16a34a;
    background: #dcfce7;
    color: #16a34a;
}

.mbl-enrg-toggle:active {
    opacity: .75;
}

/* ── Carte "Prochaine PEC" ────────────────────────────────── */

.mbl-card--next {
    border-left-width: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,.13);
}

.mbl-card__next-label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px 0;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--card-accent);
    opacity: .85;
}

/* ── Carte passée (heure PEC dépassée) ou effectuée ──────── */

.mbl-card--past {
    opacity: .45;
    filter: saturate(.3);
}

/* ── Carte "enregistrée" dans la gestion externe ─────────── */

.mbl-card--enrg {
    --card-accent: #16a34a !important;
    --card-bg: #f0fdf4;
    opacity: .8;
}

/* Enregistrée ET passée → l'enregistrement prime, pas de grisé */
.mbl-card--past.mbl-card--enrg {
    opacity: .8;
    filter: none;
}

/* ── Carte annulée par le client ─────────────────────────── */

.mbl-card--annule {
    --card-accent: #dc2626;
    opacity: .7;
}

.mbl-card--annule .mbl-card__name {
    text-decoration: line-through;
    text-decoration-color: #dc2626;
}

/* ── Séparateur passé / à venir ──────────────────────────── */

.mbl-separator {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    margin: 2px 0;
}

.mbl-separator__line {
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.mbl-separator__label {
    font-size: .6875rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

/* Badge nouvelles demandes */
.mbl-card--new .mbl-card__inner::before {
    content: '';
    position: absolute;
    top: 10px; right: 10px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

/* ── État vide ────────────────────────────────────────────── */

.mbl-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: .9375rem;
    text-align: center;
}

/* ── Vue détail ───────────────────────────────────────────── */

.mbl-detail {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 16px calc(var(--mbl-bottom-nav-h) + var(--safe-bottom) + 16px);
}

/* Carte identité */
.mbl-det-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 20px;
    margin-bottom: 12px;
}

.mbl-det-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: -20px -20px 16px;
    padding: 20px;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(135deg, #4c1d95, #a21caf);
}

/* Gradient par statut */
.mbl-det-card__header[data-statut="attente"]  { background: linear-gradient(135deg, #92400e, #f59e0b); }
.mbl-det-card__header[data-statut="modifie"]  { background: linear-gradient(135deg, #6b21a8, #a855f7); }
.mbl-det-card__header[data-statut="confirme"] { background: linear-gradient(135deg, #14532d, #16a34a); }
.mbl-det-card__header[data-statut="en_cours"] { background: linear-gradient(135deg, #4c1d95, #9333ea); }
.mbl-det-card__header[data-statut="effectue"] { background: linear-gradient(135deg, #374151, #6b7280); }
.mbl-det-card__header[data-statut="archive"]  { background: linear-gradient(135deg, #374151, #9ca3af); }

.mbl-det-card__avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.mbl-det-card__title {
    flex: 1;
    min-width: 0;
}

.mbl-det-card__name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
}

.mbl-det-card__statut {
    font-size: .8125rem;
    font-weight: 600;
    margin-top: 3px;
}

/* Champs de détail */
.mbl-det-row {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid #f1f5f9;
    font-size: .875rem;
    align-items: flex-start;
}

.mbl-det-row:first-of-type { border-top: none; }

.mbl-det-row__icon {
    flex-shrink: 0;
    color: #94a3b8;
    margin-top: 1px;
}

.mbl-det-row__label {
    flex-shrink: 0;
    width: 80px;
    font-weight: 600;
    color: #64748b;
    font-size: .8125rem;
}

.mbl-det-row__value {
    flex: 1;
    color: #1e293b;
    word-break: break-word;
}

/* Notes */
.mbl-det-notes {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: .875rem;
    color: #92400e;
    line-height: 1.5;
    margin-top: 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

.mbl-det-notes--empty {
    color: #94a3b8;
    font-style: italic;
}

/* Bouton "N fichier(s)" dans la ligne Documents */
.mbl-det-docs-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: .8125rem;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
    transition: background .12s;
}

.mbl-det-docs-btn:hover,
.mbl-det-docs-btn:active { background: #e2e8f0; }

/* Liste de documents (lazy-loaded) */
.mbl-doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: #1e293b;
    border-top: 1px solid #f1f5f9;
    font-size: .875rem;
    transition: background .1s;
}

.mbl-doc-item:active { background: #f8fafc; }

.mbl-doc-item__icon { color: #64748b; flex-shrink: 0; }

.mbl-doc-item__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mbl-doc-item__size {
    font-size: .75rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.mbl-doc-item__dl { color: #2563eb; flex-shrink: 0; }

.mbl-docs-loading,
.mbl-docs-empty,
.mbl-docs-error {
    padding: 10px 16px;
    font-size: .8125rem;
    color: #94a3b8;
}

.mbl-docs-error { color: #dc2626; }

/* Bouton crayon inline dans l'en-tête d'une ligne de détail */
.mbl-det-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .12s, color .12s;
}

.mbl-det-edit-btn:hover,
.mbl-det-edit-btn:active {
    background: #f1f5f9;
    color: #475569;
}

.mbl-det-card__header .mbl-det-edit-btn {
    color: rgba(255,255,255,.7);
}

.mbl-det-card__header .mbl-det-edit-btn:hover,
.mbl-det-card__header .mbl-det-edit-btn:active {
    background: rgba(255,255,255,.15);
    color: #fff;
}

/* Textarea dans les modals */
.mbl-modal-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: .9375rem;
    font-family: inherit;
    line-height: 1.5;
    color: #1e293b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    resize: vertical;
    transition: border-color .15s;
    -webkit-appearance: none;
}

.mbl-modal-textarea:focus {
    border-color: #2563eb;
    background: #fff;
}

/* ── Boutons d'action dans le détail ──────────────────────── */

.mbl-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.mbl-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 12px;
    border: none;
    border-radius: 12px;
    font-size: .9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    -webkit-user-select: none;
    user-select: none;
}

.mbl-btn:active { transform: scale(.96); }
.mbl-btn:disabled { opacity: .5; cursor: default; }

.mbl-btn--confirm {
    background: var(--confirm-color);
    color: #fff;
}

.mbl-btn--start {
    background: var(--start-color);
    color: #fff;
}

.mbl-btn--done {
    background: var(--done-color);
    color: #fff;
}

.mbl-btn--archive {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.mbl-btn--refuse {
    background: #fff;
    color: var(--refuse-color);
    border: 2px solid var(--refuse-color);
}

.mbl-btn--pec {
    background: #e0f2fe;
    color: #0369a1;
    border: 2px solid #bae6fd;
}

/* ── En-têtes de tranche horaire (Aujourd'hui) ────────────────────────────── */

.mbl-time-header {
    list-style: none;
    padding: 10px 4px 4px;
    font-size: .6875rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mbl-time-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ── Toolbar archive (bouton Actualiser) ─────────────────────────────────── */

.mbl-archive-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 8px 16px 4px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.mbl-archive-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    color: #64748b;
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.mbl-archive-refresh:active {
    background: #ede9fe;
    border-color: #7c3aed;
    color: #7c3aed;
}

/* ── Bouton "Charger plus" (pagination archives) ─────────────────────────── */

.mbl-load-more {
    display: block;
    width: calc(100% - 32px);
    margin: 8px 16px 16px;
    padding: 13px;
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    color: #7c3aed;
    font-size: .9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background .13s, border-color .13s;
}

.mbl-load-more:active {
    background: #ede9fe;
    border-color: #7c3aed;
}

.mbl-load-more:disabled {
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: default;
}

/* ── Pull-to-Refresh ───────────────────────────────────────────────────────── */

.mbl-ptr {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    height: 44px;
    color: #a855f7;
    font-size: .8125rem;
    font-weight: 500;
    background: #fdf4ff;
    border-bottom: 1px solid #e9d5ff;
    opacity: 0;
    transform: translateY(-100%);
    will-change: opacity, transform;
    overflow: hidden;
}

.mbl-ptr__ring {
    flex-shrink: 0;
    display: none;
}

.mbl-ptr--syncing .mbl-ptr__ring {
    display: block;
    animation: mbl-spin 0.75s linear infinite;
}

/* ── Page de connexion mobile ─────────────────────────────────────────────── */
/* Activé via <body class="mbl-login-body"> dans le layout mobile-login.      */

body.mbl-login-body {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(155deg, #0f172a 0%, #1e3a5f 55%, #0f172a 100%);
    align-items: center;
    justify-content: center;
    padding: 28px 20px calc(var(--safe-bottom, 0px) + 28px);
    padding-top: calc(var(--safe-top, 0px) + 28px);
}

.mbl-login-wrap {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Branding */
.mbl-login-brand {
    text-align: center;
    color: #fff;
}

.mbl-login-brand__icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 16px;
    border-radius: 22px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

.mbl-login-brand__name {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.5px;
    color: #fff;
}

.mbl-login-brand__sub {
    font-size: 14px;
    color: rgba(255,255,255,.5);
    margin-top: 5px;
    font-weight: 400;
}

/* Carte formulaire */
.mbl-login-card {
    background: rgba(255,255,255,.97);
    border-radius: 22px;
    padding: 30px 24px;
    box-shadow:
        0 24px 64px rgba(0,0,0,.4),
        0 2px 0 rgba(255,255,255,.06) inset;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Erreur flash */
.mbl-login-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Champs */
.mbl-login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mbl-login-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    letter-spacing: .2px;
    user-select: none;
}

.mbl-login-input {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    color: #1e293b;
    background: #f8fafc;
    outline: none;
    -webkit-appearance: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.mbl-login-input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.mbl-login-input::placeholder {
    color: #94a3b8;
}

/* Ligne "Rester connecté" */
.mbl-login-remember {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.mbl-login-remember__check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    accent-color: #7c3aed;
    cursor: pointer;
    flex-shrink: 0;
}

.mbl-login-remember__label {
    font-size: .9375rem;
    font-weight: 500;
    color: #475569;
}

/* Bouton principal */
.mbl-login-submit {
    width: 100%;
    min-height: 52px;
    padding: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 4px 16px rgba(99,102,241,.35);
    -webkit-appearance: none;
}

.mbl-login-submit:active:not(:disabled) {
    transform: scale(.98);
    box-shadow: 0 2px 8px rgba(99,102,241,.25);
}

.mbl-login-submit:disabled {
    opacity: .75;
    cursor: default;
    transform: none;
}

/* Spinner inline dans le bouton */
.mbl-btn-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mbl-spin .65s linear infinite;
    flex-shrink: 0;
}

/* Overlay plein écran — serveur lent */
.mbl-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(155deg, #0f172a 0%, #1e3a5f 55%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
}

.mbl-login-overlay--visible {
    opacity: 1;
    pointer-events: all;
}

.mbl-login-overlay__icon {
    font-size: 44px;
    animation: mbl-float 2s ease-in-out infinite;
}

.mbl-login-overlay__ring {
    width: 52px;
    height: 52px;
    border: 3.5px solid rgba(99,102,241,.25);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: mbl-spin .75s linear infinite;
}

.mbl-login-overlay__label {
    color: rgba(255,255,255,.65);
    font-size: 15px;
    font-weight: 500;
    animation: mbl-pulse 2s ease-in-out infinite;
}

.mbl-login-overlay__dots {
    display: inline-flex;
    gap: 6px;
    margin-top: -8px;
}

.mbl-login-overlay__dots span {
    width: 6px;
    height: 6px;
    background: rgba(99,102,241,.6);
    border-radius: 50%;
    animation: mbl-dot-bounce .9s ease-in-out infinite;
}

.mbl-login-overlay__dots span:nth-child(2) { animation-delay: .15s; }
.mbl-login-overlay__dots span:nth-child(3) { animation-delay: .3s; }

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

@keyframes mbl-pulse {
    0%, 100% { opacity: .5; }
    50%       { opacity: 1; }
}

@keyframes mbl-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

@keyframes mbl-dot-bounce {
    0%, 100% { transform: translateY(0);    opacity: .4; }
    50%       { transform: translateY(-5px); opacity: 1; }
}

.mbl-btn--enrg {
    background: #16a34a;
    color: #fff;
    border: 2px solid #16a34a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mbl-btn--delete {
    background: #fff;
    color: #dc2626;
    border: 2px solid #fca5a5;
}

.mbl-btn--neutral {
    background: #f1f5f9;
    color: #475569;
}

.mbl-btn--loading {
    position: relative;
    color: transparent !important;
}

.mbl-btn--loading::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: mbl-spin .6s linear infinite;
    color: #fff;
}

.mbl-btn--refuse.mbl-btn--loading::after { color: var(--refuse-color); }

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

/* Section appel rapide */
.mbl-det-phone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 14px;
    text-decoration: none;
    color: #15803d;
    font-weight: 600;
    font-size: .9375rem;
    margin-top: 4px;
    transition: background .15s;
}

.mbl-det-phone:active { background: #dcfce7; }

/* Bouton partage WhatsApp */
.mbl-det-whatsapp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 14px;
    padding: 14px 16px;
    color: #15803d;
    font-weight: 600;
    text-decoration: none;
    font-size: .9375rem;
    margin-top: 4px;
    transition: background .15s;
}

.mbl-det-whatsapp > span:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mbl-det-whatsapp:active { background: #dcfce7; }

/* ── Toast ────────────────────────────────────────────────── */

.mbl-toasts {
    position: fixed;
    bottom: calc(20px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: min(320px, calc(100vw - 32px));
}

.mbl-toast {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: .875rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    animation: mbl-toast-in .25s ease-out;
    pointer-events: auto;
}

.mbl-toast--success { background: #16a34a; }
.mbl-toast--error   { background: #dc2626; }
.mbl-toast--warn    { background: #d97706; }
.mbl-toast--info    { background: #2563eb; }

@keyframes mbl-toast-in {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Overlay loader ───────────────────────────────────────── */

.mbl-loader {
    position: fixed;
    inset: 0;
    background: #f5f3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity .3s;
}

.mbl-loader--hidden {
    opacity: 0;
    pointer-events: none;
}

.mbl-loader__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9d5ff;
    border-top-color: #a21caf;
    border-radius: 50%;
    animation: mbl-spin .8s linear infinite;
}

/* ── Conflict modal ───────────────────────────────────────── */

.mbl-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 5000;
    display: flex;
    align-items: flex-end;
    padding: 0 0 var(--safe-bottom);
}

.mbl-modal {
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px 20px calc(16px + var(--safe-bottom));
    width: 100%;
    max-height: 70dvh;
    overflow-y: auto;
}

.mbl-modal__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.mbl-modal__body {
    font-size: .875rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 20px;
}

.mbl-modal__actions {
    display: flex;
    gap: 10px;
}

/* ── Modal pleine hauteur (formulaire édition RDV) ────────── */

.mbl-modal--full {
    display: flex;
    flex-direction: column;
    padding: 0;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
}

.mbl-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.mbl-modal__header .mbl-modal__title {
    margin-bottom: 0;
}

.mbl-modal__close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.mbl-modal__footer {
    padding: 12px 20px calc(12px + var(--safe-bottom));
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.mbl-modal__footer .mbl-btn {
    width: 100%;
    justify-content: center;
}

/* ── Formulaire d'édition RDV ──────────────────────────────── */

.mbl-edit-form {
    padding: 4px 20px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mbl-edit-section {
    margin-bottom: 12px;
}

.mbl-edit-section__title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
    margin-bottom: 8px;
    padding-top: 4px;
}

/* ── Time picker (partagé avec style.css, adapté mobile) ─── */

.time-pick {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .7rem 1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    user-select: none;
    min-height: 48px;
}

.time-pick:hover,
.time-pick:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
    outline: none;
}

.time-pick.has-value .time-pick__text {
    color: #1e293b;
    font-weight: 500;
}

.time-pick__icon {
    color: #9ca3af;
    flex-shrink: 0;
    transition: color .15s;
}

.time-pick:hover .time-pick__icon,
.time-pick:focus .time-pick__icon { color: #6366f1; }

.time-pick__text {
    flex: 1;
    font-size: .95rem;
    color: #9ca3af;
}

.tp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s;
}

.tp-overlay.tp-visible {
    opacity: 1;
    pointer-events: auto;
}

.tp-box {
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem 2rem 1.5rem;
    width: 100%;
    max-width: 280px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    transform: translateY(12px) scale(.97);
    transition: transform .18s, opacity .18s;
    text-align: center;
}

.tp-overlay.tp-visible .tp-box { transform: translateY(0) scale(1); }

.tp-title { font-size: 1rem; font-weight: 700; color: #1e293b; margin-bottom: .25rem; }

.tp-hint { font-size: .75rem; color: #9ca3af; margin-bottom: 1.25rem; }

.tp-fields {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.tp-unit { display: flex; flex-direction: column; align-items: center; gap: .35rem; }

.tp-btn {
    width: 40px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: .9rem;
    cursor: pointer;
    color: #64748b;
    transition: background .12s, color .12s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tp-btn:hover { background: #6366f1; color: #fff; }

.tp-drum {
    width: 72px;
    height: 64px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    touch-action: none;
    user-select: none;
    position: relative;
    transition: border-color .15s, box-shadow .15s, background .1s;
    background: #fafafa;
}

.tp-drum:hover { border-color: #6366f1; background: #f5f4ff; }

.tp-drum.tp-dragging {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
    background: #f0effe;
}

.tp-drum.tp-editing { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); cursor: text; }

.tp-val { font-size: 1.9rem; font-weight: 700; color: #1e293b; line-height: 1; pointer-events: none; transition: opacity .1s; }

.tp-drum.tp-editing .tp-val { opacity: 0; }

.tp-edit {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 1.9rem;
    font-weight: 700;
    text-align: center;
    color: #1e293b;
    outline: none;
    opacity: 0;
    pointer-events: none;
    padding: 0;
    cursor: text;
}

.tp-drum.tp-editing .tp-edit { opacity: 1; pointer-events: auto; }

.tp-sep { font-size: 2rem; font-weight: 700; color: #6366f1; line-height: 1; padding-bottom: .2rem; }

.tp-label { font-size: .72rem; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

.tp-validate {
    width: 100%;
    padding: .7rem;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.tp-validate:hover { background: #4f46e5; }

/* ── Lieu search dans modal édition ───────────────────────── */

.mbl-lieu-sugg {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.mbl-lieu-sugg li {
    padding: 10px 14px;
    font-size: .875rem;
    color: #1e293b;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.mbl-lieu-sugg li:last-child { border-bottom: none; }

.mbl-lieu-sugg li:hover,
.mbl-lieu-sugg li.active { background: #f5f4ff; color: #4f46e5; }

.mbl-lieu-sugg__ville {
    font-size: .75rem;
    color: #94a3b8;
    margin-left: 6px;
}

.mbl-lieu-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 0;
    background: none;
    border: none;
    font-size: .8125rem;
    color: #6366f1;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.mbl-lieu-toggle:hover { color: #4f46e5; }

/* ── Autocomplete médecin (adresse libre) ─────────────────── */

.medecin-ac-list {
    position:   absolute;
    top:        calc(100% + 2px);
    left:       0;
    right:      0;
    z-index:    6500;
    list-style: none;
    margin:     0;
    padding:    4px 0;
    background: #fff;
    border:     1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.medecin-ac-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background .12s;
}

.medecin-ac-item:last-child { border-bottom: none; }

.medecin-ac-item:hover,
.medecin-ac-item.is-active { background: #f5f3ff; }

.medecin-ac-name {
    font-size: .875rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.medecin-ac-addr {
    font-size: .75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Badge couleurs statuts ───────────────────────────────── */

.mbl-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .75rem; font-weight: 700; }
.mbl-badge--attente  { background: #fef3c7; color: #92400e; }
.mbl-badge--confirme { background: #dbeafe; color: #1d4ed8; }
.mbl-badge--modifie  { background: #ede9fe; color: #5b21b6; }
.mbl-badge--annule_c, .mbl-badge--annule_s { background: #fee2e2; color: #991b1b; }
.mbl-badge--archive  { background: #f1f5f9; color: #64748b; }

/* ── Pull-to-refresh indicator ────────────────────────────── */

.mbl-ptr {
    text-align: center;
    padding: 12px;
    font-size: .8125rem;
    color: #94a3b8;
    overflow: hidden;
    max-height: 0;
    transition: max-height .2s;
}

.mbl-ptr--visible { max-height: 48px; }

/* ── Modal heure PEC ──────────────────────────────────────── */

.mbl-modal-label {
    display: block;
    font-size: .8125rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.mbl-modal-time {
    display: block;
    width: 100%;
    padding: 14px 16px;
    font-size: 1.375rem;
    font-weight: 700;
    text-align: center;
    color: #1e293b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: border-color .15s;
    -webkit-appearance: none;
}

.mbl-modal-time:focus {
    border-color: #2563eb;
    background: #fff;
}

/* ── Semaine : bandeau de la période ─────────────────────── */

.mbl-week-header {
    padding: 8px 16px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-size: .8125rem;
    font-weight: 600;
    color: #475569;
    text-align: center;
    letter-spacing: .01em;
}

/* ── Planning : barre navigation mois ────────────────────── */

.mbl-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mbl-month-nav__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    transition: background .15s;
}

.mbl-month-nav__btn:active {
    background: #e2e8f0;
}

.mbl-month-nav__label {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -.01em;
}

/* ── Filtre type transport (onglet À traiter) ────────────────── */

.mbl-transport-filter {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.mbl-tf-btn {
    flex: 1;
    min-height: 44px;
    padding: 0 8px;
    border: 1.5px solid #e2e8f0;
    border-radius: 22px;
    background: #f8fafc;
    color: #64748b;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, color .18s, border-color .18s, box-shadow .18s, transform .1s;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    -webkit-tap-highlight-color: transparent;
}

.mbl-tf-btn:active {
    transform: scale(.96);
}

.mbl-tf-btn--active[data-filter="all"] {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-color: #1e293b;
    color: #fff;
    box-shadow: 0 4px 10px rgba(30,41,59,.35);
}

.mbl-tf-btn--active[data-filter="medical"] {
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
    border-color: #1d4ed8;
    color: #fff;
    box-shadow: 0 4px 10px rgba(29,78,216,.35);
}

.mbl-tf-btn--active[data-filter="standard"] {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 100%);
    border-color: #c2410c;
    color: #fff;
    box-shadow: 0 4px 10px rgba(194,65,12,.35);
}

/* ── Bottom-sheet long-press "Enregistré + archivé" ─────── */

#mbl-enrg-sheet {
    position: fixed;
    inset: 0;
    z-index: 600;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}

#mbl-enrg-sheet.mbl-enrg-sheet--visible {
    opacity: 1;
    pointer-events: auto;
}

.mbl-enrg-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}

.mbl-enrg-sheet__box {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px 24px calc(28px + var(--safe-bottom));
    box-shadow: 0 -4px 24px rgba(0,0,0,.15);
    transform: translateY(40px);
    transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}

.mbl-enrg-sheet__icon,
.mbl-enrg-sheet__msg,
.mbl-enrg-sheet__btn,
.mbl-enrg-sheet__wa {
    text-align: center;
}

#mbl-enrg-sheet.mbl-enrg-sheet--visible .mbl-enrg-sheet__box {
    transform: translateY(0);
}

.mbl-enrg-sheet__name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 14px;
    text-align: center;
}

.mbl-enrg-sheet__check {
    font-size: 1.3rem;
    color: #16a34a;
    font-weight: 700;
}

.mbl-enrg-sheet__icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.mbl-enrg-sheet__msg {
    font-size: .875rem;
    font-weight: 500;
    color: #475569;
    margin: 0 0 20px;
    line-height: 1.5;
}

.mbl-enrg-sheet__btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(22,163,74,.35);
    transition: transform .1s, box-shadow .1s;
}

.mbl-enrg-sheet__btn:active {
    transform: scale(.97);
    box-shadow: 0 2px 6px rgba(22,163,74,.25);
}

.mbl-enrg-sheet__wa {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(18,140,126,.35);
    transition: transform .1s, box-shadow .1s;
}

.mbl-enrg-sheet__wa:active {
    transform: scale(.97);
    box-shadow: 0 2px 6px rgba(18,140,126,.25);
}

/* ── Planning : headers de groupe date ────────────────────── */

.mbl-planning-header {
    list-style: none;
    padding: 10px 16px 6px;
    font-size: .75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mbl-planning-header__count {
    font-weight: 500;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
}

.mbl-planning-empty,
.mbl-planning-loading {
    list-style: none;
    text-align: center;
    padding: 48px 16px;
    color: #94a3b8;
    font-size: .9rem;
}

/* ── Menu utilisateur (bottom sheet) ──────────────────────── */

/* Conteneur de la modal : aucun padding interne, on gère par zones */
.mbl-user-menu {
    padding: 0;
    overflow: hidden;
}

/* ── En-tête dégradé violet → fuchsia ── */
.mbl-user-menu__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 20px 20px;
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 50%, #a21caf 100%);
    position: relative;
}

/* Cercle décoratif en fond du header */
.mbl-user-menu__header::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    pointer-events: none;
}

/* Avatar rond avec anneau lumineux */
.mbl-user-menu__avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    border: 2px solid rgba(255,255,255,.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 800;
    flex-shrink: 0;
    letter-spacing: .03em;
    box-shadow: 0 0 0 4px rgba(255,255,255,.1);
}

.mbl-user-menu__info {
    flex: 1;
    min-width: 0;
}

.mbl-user-menu__name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mbl-user-menu__email {
    font-size: .8125rem;
    color: rgba(255,255,255,.75);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mbl-user-menu__societe {
    font-size: .75rem;
    color: rgba(255,255,255,.55);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Liste des actions ── */
.mbl-user-menu__items {
    display: flex;
    flex-direction: column;
    padding: 10px 12px 6px;
}

.mbl-user-menu__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 10px;
    font-size: .9375rem;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    border-radius: 12px;
    transition: background .13s;
    position: relative;
    /* reset bouton natif */
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.mbl-user-menu__item:active {
    background: #f1f5f9;
}

/* Chevron automatique sur chaque item (sauf danger) */
.mbl-user-menu__item:not(.mbl-user-menu__item--danger)::after {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-right: 2px solid #cbd5e1;
    border-top: 2px solid #cbd5e1;
    transform: rotate(45deg);
    margin-left: auto;
    flex-shrink: 0;
}

/* Bulle d'icône colorée */
.mbl-user-menu__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mbl-user-menu__icon--violet {
    background: #ede9fe;
    color: #7c3aed;
}

.mbl-user-menu__icon--blue {
    background: #dbeafe;
    color: #2563eb;
}

.mbl-user-menu__icon--indigo {
    background: #e0e7ff;
    color: #4338ca;
}

.mbl-user-menu__icon--teal {
    background: #ccfbf1;
    color: #0f766e;
}

.mbl-user-menu__icon--red {
    background: #fee2e2;
    color: #dc2626;
}
.mbl-user-menu__icon--green {
    background: #dcfce7;
    color: #16a34a;
}

/* Item danger : texte rouge, pas de chevron */
.mbl-user-menu__item--danger {
    color: #dc2626;
    margin-top: 2px;
    margin-bottom: 4px;
}

.mbl-user-menu__sep {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 2px;
}

/* ── Formulaires standalone (mon-compte, etc.) ────────────── */

.mbl-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mbl-form-label {
    font-size: .8125rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .04em;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.mbl-form-hint {
    font-size: .75rem;
    font-weight: 400;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
}

.mbl-form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    color: #1e293b;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: border-color .15s;
    -webkit-appearance: none;
}

.mbl-form-input:focus {
    border-color: #2563eb;
}

.mbl-form-field--error .mbl-form-input {
    border-color: #dc2626;
}

.mbl-form-error {
    font-size: .8125rem;
    color: #dc2626;
    font-weight: 500;
}

.mbl-form-section {
    font-size: .75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 8px 0 4px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 4px;
}

/* ── QR Code prise de RDV ───────────────────────────────────────────────── */
.mbl-qr-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 8px;
}
.mbl-qr-canvas {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    line-height: 0;
}
.mbl-qr-url {
    font-size: .75rem;
    color: #64748b;
    word-break: break-all;
    text-align: center;
    margin: 0;
}
.mbl-qr-copy {
    font-size: .8rem;
    padding: 8px 20px;
    border-radius: 8px;
    border: 1.5px solid #c7d2fe;
    background: #fff;
    color: #4f46e5;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.mbl-qr-copy:hover { background: #eef2ff; }
.mbl-qr-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #94a3b8;
    margin: 0;
}
/* ── Overlay QR plein écran ──────────────────────────────────────────────── */
.mbl-qr-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 15, 30, .85);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: mbl-fade-in .18s ease;
}
.mbl-qr-overlay__card {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(360px, calc(100vw - 32px));
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.mbl-qr-overlay__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
}
.mbl-qr-overlay__close:hover { background: #e2e8f0; }
.mbl-qr-overlay__title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}
.mbl-qr-overlay__sub {
    font-size: .8rem;
    color: #64748b;
    margin: -8px 0 0;
}
.mbl-qr-overlay__canvas {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    line-height: 0;
}
.mbl-qr-overlay__url {
    font-size: .72rem;
    color: #94a3b8;
    word-break: break-all;
    text-align: center;
    margin: 0;
    max-width: 280px;
}
.mbl-qr-overlay__copy {
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    border: 1.5px solid #c7d2fe;
    background: #fff;
    color: #4f46e5;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.mbl-qr-overlay__copy:hover { background: #eef2ff; }

.mbl-form-success {
    background: #dcfce7;
    color: #15803d;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

/* ── Utilitaires ──────────────────────────────────────────── */

.u-hidden { display: none !important; }
