/* ============================================
   OFFCANVAS DILIGENCES PARTAGÉ
   ============================================ */
.dil-offcanvas-fullscreen {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    background: linear-gradient(180deg, var(--ges-green-50, #f0fdf4) 0%, #ffffff 100%) !important;
    border-left: none !important;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* ============================================
   HEADER - Miroir haut
   ============================================ */
.dil-offcanvas-fullscreen .offcanvas-header {
    background: linear-gradient(135deg, #ffffff 0%, var(--ges-green-50, #f0fdf4) 100%);
    background-color: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--ges-border, #e2e8f0);
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0 !important;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
}

/* ============================================
   BODY - Zone scrollable
   ============================================ */
.dil-offcanvas-fullscreen .offcanvas-body {
    flex: 1 1 0% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
    padding: 1.5rem 2rem 0 2rem !important;
    display: block !important;
    -webkit-overflow-scrolling: touch;
}

/* Titres */
.dil-offcanvas-fullscreen .offcanvas-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ges-green-900, #14532d);
    margin: 0;
}
.dil-offcanvas-fullscreen .offcanvas-title i {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.dil-offcanvas-fullscreen .offcanvas-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   SECTIONS DU FORMULAIRE
   ============================================ */
.dil-form-section {
    background: #ffffff;
    border: 1px solid var(--ges-border, #e2e8f0);
    border-radius: 12px;
    overflow: visible !important;
    margin-bottom: 1.5rem;
    flex-shrink: 0 !important;
    width: 100%;
    box-sizing: border-box;
}
.dil-form-section-header {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--ges-green-50, #f0fdf4), #ffffff);
    border-bottom: 1px solid var(--ges-border, #e2e8f0);
    font-weight: 600;
    color: var(--ges-green-800, #166534);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dil-form-section-body {
    padding: 1.25rem;
    overflow: visible !important;
}

/* Form controls */
.form-control-dil, .form-select-dil {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    border: 1px solid var(--ges-border, #e2e8f0);
    border-radius: 8px;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #ffffff;
}
.form-control-dil:focus, .form-select-dil:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgb(34 197 94 / 0.15);
}
.form-control-dil[readonly] {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}
textarea.form-control-dil {
    resize: vertical;
    min-height: 60px;
}

/* Boutons */
.btn-dil {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-dil-primary {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    box-shadow: 0 4px 14px rgb(22 163 74 / 0.15);
}
.btn-dil-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #15803d, #166534);
    transform: translateY(-1px);
}
.btn-dil-ghost {
    background: transparent;
    color: #64748b;
}
.btn-dil-ghost:hover {
    background: var(--ges-green-50, #f0fdf4);
    color: var(--ges-green-700, #15803d);
}

/* ============================================
   FOOTER - MIROIR PARFAIT DU HEADER
   ============================================ */
.dil-actions-sticky {
    position: sticky;
    bottom: 0;
    background: linear-gradient(135deg, #ffffff 0%, var(--ges-green-50, #f0fdf4) 100%);
    background-color: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--ges-border, #e2e8f0);
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0 !important;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.05);
    margin-top: 1rem;
}

.dil-actions-sticky:hover {
    box-shadow: 0 -6px 10px -2px rgb(0 0 0 / 0.08);
}

/* ============================================
   BADGE SOURCE
   ============================================ */
.dil-badge-source {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
}
.dil-badge-source.reunion { background: #dbeafe; color: #1e40af; }
.dil-badge-source.mission { background: #ffedd5; color: #c2410c; }
.dil-badge-source.formation { background: #f3e8ff; color: #7e22ce; }
.dil-badge-source.ptba { background: #dcfce7; color: #15803d; }
.dil-badge-source.independant { background: #f1f5f9; color: #475569; }

/* ============================================
   TOAST
   ============================================ */
.dil-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

/* ============================================
   TIMELINE HISTORIQUE
   ============================================ */
.timeline {
    position: relative;
    padding-left: 20px;
}
.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-left: 1.5rem;
}
.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: var(--ges-border);
}
.timeline-badge {
    position: absolute;
    left: -20px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    z-index: 2;
}
.timeline-badge.success { background: var(--ges-green-500); }
.timeline-badge.warning { background: var(--ges-warning); }
.timeline-content {
    background: var(--ges-bg);
    border: 1px solid var(--ges-border);
    border-radius: 8px;
    padding: 0.75rem;
}
