﻿/* Animation fadeIn */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dossiers Médicaux */
.dossiers-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 100%;
}

.dossier-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.dossier-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.15);
}

.dossier-card.deceased {
    border-color: rgba(237, 66, 69, 0.55);
    background: linear-gradient(135deg, rgba(237, 66, 69, 0.08) 0%, var(--bg-dark) 100%);
}

.dossier-card.deceased:hover {
    border-color: rgba(237, 66, 69, 0.75);
    box-shadow: 0 4px 14px rgba(237, 66, 69, 0.2);
}

.dossier-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 250px;
}

.dossier-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.dossier-card-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.dossier-name-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.dossier-name-row h4 {
    margin: 0;
}

.dossier-deceased-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(237, 66, 69, 0.7);
    border-radius: 999px;
    color: var(--danger);
    background: rgba(237, 66, 69, 0.14);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dossier-deceased-badge i[data-lucide] {
    width: 0.8rem;
    height: 0.8rem;
}

.dossier-deceased-date {
    color: var(--danger);
    font-weight: 600;
}

.dossier-card-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.dossier-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 2rem;
}

.dossier-card-details {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex: 1;
}

.dossier-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.dossier-detail-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dossier-detail-label i[data-lucide] {
    width: 0.9rem;
    height: 0.9rem;
}

.dossier-card-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dossier-card-info p i[data-lucide] {
    width: 0.85rem;
    height: 0.85rem;
}

.dossier-detail-value {
    font-weight: 500;
    color: var(--text);
}

.btn-acceder {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-acceder:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.btn-delete-dossier {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.65rem;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
}

.btn-delete-dossier:hover {
    background: rgba(237, 66, 69, 0.15);
    border-color: var(--danger);
    color: var(--danger);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 66, 69, 0.2);
}

.btn-delete-dossier:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-delete-dossier i[data-lucide] {
    width: 1.1rem;
    height: 1.1rem;
}

/* ==================== PATIENTS DÃ‰CÃ‰DÃ‰S ==================== */

.deceased-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.deceased-card-compact {
    background: linear-gradient(135deg, rgba(237, 66, 69, 0.08) 0%, var(--bg-dark) 100%);
    border: 2px solid rgba(237, 66, 69, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.25s ease;
}

.deceased-card-compact:hover {
    border-color: rgba(237, 66, 69, 0.6);
    box-shadow: 0 8px 24px rgba(237, 66, 69, 0.15);
    transform: translateY(-2px);
}

.deceased-card-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.deceased-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--danger) 0%, rgba(237, 66, 69, 0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(237, 66, 69, 0.3);
}

.deceased-card-avatar i[data-lucide] {
    width: 28px;
    height: 28px;
}

.deceased-card-main {
    flex: 1;
}

.deceased-card-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.deceased-card-date-birth {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.deceased-card-date-birth i[data-lucide] {
    width: 0.9rem;
    height: 0.9rem;
}

.deceased-badge-prominent {
    background: rgba(237, 66, 69, 0.15);
    border: 2px solid var(--danger);
    color: var(--danger);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.deceased-badge-prominent i[data-lucide] {
    width: 1.1rem;
    height: 1.1rem;
}

.deceased-card-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(237, 66, 69, 0.2);
}

.deceased-detail {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.deceased-detail label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.deceased-detail label i[data-lucide] {
    width: 0.85rem;
    height: 0.85rem;
}

.deceased-detail span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Modal sÃ©lection patient */
.patient-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
}

.patient-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border);
}

.patient-item:hover {
    background: var(--bg-light);
}

.patient-item:last-child {
    border-bottom: none;
}

.patient-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.patient-item-info {
    flex: 1;
    min-width: 0;
}

.patient-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.patient-item-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
}

.patient-item-detail i[data-lucide] {
    width: 0.85rem;
    height: 0.85rem;
}

.patient-item-action {
    flex-shrink: 0;
}

.btn-select {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-select:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.btn-select i[data-lucide] {
    width: 1rem;
    height: 1rem;
}

/* Banderole Patient DÃ©cÃ©dÃ© */
.deceased-banner {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    border: 2px solid #a93226;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: pulse-alert 2s ease-in-out infinite;
}

.deceased-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.deceased-banner-content i[data-lucide] {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.deceased-banner-text {
    flex: 1;
}

.deceased-banner-text strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.deceased-banner-text p {
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
    opacity: 0.95;
}

.deceased-banner-text span {
    font-weight: 600;
    display: inline-block;
}

@keyframes pulse-alert {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.dossier-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    min-height: 600px;
}

.dossier-sidebar {
    background: var(--bg-darker);
    padding: 1.5rem;
    border-right: 1px solid var(--border);
}

.dossier-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.dossier-info-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.dossier-info-grid {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dossier-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dossier-info-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.dossier-info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.dossier-content {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 80vh;
}

/* Dossier modal â€“ plein Ã©cran */
#dossier-modal {
    align-items: flex-start;
    background: var(--bg-primary, #1a1a2e);
}

#dossier-modal > .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
}

#dossier-modal > .modal-content > .modal-body {
    flex: 1;
    overflow: hidden;
    max-height: none;
    padding: 0;
}

#dossier-modal .dossier-layout {
    height: calc(100vh - 80px);
}

#dossier-modal .dossier-content {
    max-height: calc(100vh - 80px);
}

#dossier-modal .dossier-sidebar {
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

#create-dossier-modal,
#create-certificat-modal,
#create-evaluation-modal {
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
    padding: 0;
}

#create-dossier-modal > .modal-content,
#create-certificat-modal > .modal-content,
#create-evaluation-modal > .modal-content {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

#create-certificat-modal > .modal-content,
#create-evaluation-modal > .modal-content {
    background: var(--bg-secondary) !important;
}

#create-dossier-modal > .modal-content > .modal-body,
#create-certificat-modal #create-certificat-form,
#create-evaluation-modal #create-evaluation-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-secondary);
}

#create-certificat-modal .modal-body,
#create-evaluation-modal .modal-body,
#create-dossier-modal > .modal-content > .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem;
    box-sizing: border-box;
    background: transparent;
}

#create-certificat-modal .modal-header,
#create-evaluation-modal .modal-header {
    flex-shrink: 0;
}

#create-certificat-modal .modal-actions,
#create-evaluation-modal .modal-actions {
    position: static;
    background: transparent !important;
    border-top: none !important;
    box-shadow: none !important;
    padding: 0.75rem 1.25rem 0.85rem !important;
    margin-top: 0 !important;
    margin-bottom: 0;
    z-index: 1;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

#create-certificat-modal .modal-actions .btn-primary,
#create-certificat-modal .modal-actions .btn-secondary,
#create-evaluation-modal .modal-actions .btn-primary,
#create-evaluation-modal .modal-actions .btn-secondary {
    width: auto;
    min-width: unset;
    max-width: none;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.95rem !important;
    font-size: 0.875rem;
    line-height: 1;
    min-height: 2.25rem;
    white-space: nowrap;
    gap: 0.35rem;
    box-sizing: border-box;
}

#create-certificat-modal .modal-actions .btn-secondary,
#create-evaluation-modal .modal-actions .btn-secondary {
    border: 1px solid var(--border);
}

#create-certificat-modal .modal-actions .btn-primary,
#create-evaluation-modal .modal-actions .btn-primary {
    border: 1px solid transparent;
}

.modal-hrp-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(237, 66, 69, 0.15);
    border: 1px solid rgba(237, 66, 69, 0.35);
    border-left: 4px solid rgba(237, 66, 69, 0.85);
    border-radius: 10px;
    color: #f8f8f8;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    max-width: 100%;
}

.modal-hrp-banner i[data-lucide] {
    width: 18px;
    height: 18px;
    color: #ffe7e7;
    flex-shrink: 0;
}

.modal-hrp-banner span {
    color: #ffffff;
}

/* Modal marquer dÃ©cÃ©dÃ© â€“ plein Ã©cran, liste occupe la hauteur restante */
#mark-deceased-modal {
    align-items: flex-start;
    justify-content: flex-start;
}

#mark-deceased-modal > .modal-content {
    overflow: hidden;
}

#mark-deceased-modal .modal-header {
    flex-shrink: 0;
}

#mark-deceased-modal > .modal-content > .modal-body {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    padding: 0.875rem 0.75rem 1rem;
}

@media (min-width: 768px) {
    #mark-deceased-modal > .modal-content > .modal-body {
        padding: 1rem 1.25rem 1.25rem;
    }
}

#mark-deceased-modal .modal-body > p {
    margin-bottom: 1rem;
}

#mark-deceased-modal .mark-deceased-modal-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#mark-deceased-modal .mark-deceased-modal-body > p {
    flex-shrink: 0;
}

#mark-deceased-modal .modal-body > .search-container {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

/* Zone liste : scroll interne, bouton « charger plus » toujours visible en bas */
#mark-deceased-modal .patient-list {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    padding: 0.5rem 0.65rem;
    border-radius: 12px;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    overflow-y: auto;
}

#mark-deceased-modal .patient-load-more-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    padding: 0.85rem 0 0.25rem;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
    background: var(--bg-secondary);
}

@media (max-width: 767px) {
    #mark-deceased-modal .patient-list {
        min-height: 200px;
    }
}

#mark-deceased-modal .patient-item {
    padding: 1.15rem 1.1rem;
    gap: 1.15rem;
    align-items: center;
}

#mark-deceased-modal .patient-item-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
}

#mark-deceased-modal .patient-item-name {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

#mark-deceased-modal .patient-item-detail {
    font-size: 0.9rem;
    flex-wrap: wrap;
}

#mark-deceased-modal .patient-item-detail i[data-lucide] {
    width: 0.95rem;
    height: 0.95rem;
}

#mark-deceased-modal .btn-select {
    padding: 0.65rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 8px;
}

#mark-deceased-modal .btn-select i[data-lucide] {
    width: 1.1rem;
    height: 1.1rem;
}

.dossier-section {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dossier-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.info-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.info-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-field label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-field input,
.info-field select,
.info-field textarea {
    padding: 0.75rem;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.info-field input[readonly] {
    background: var(--bg-light);
    cursor: not-allowed;
}

.info-btn-reveal {
    padding: 0.75rem;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.info-btn-reveal:hover {
    background: #4752C4;
}

.info-checkboxes {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.info-checkboxes label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.dossier-timeline {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-y: auto;
}

.dossier-timeline .timeline-item {
    position: relative;
    padding-left: 3rem;
    padding-bottom: 0.5rem;
    border-left: 3px solid #e74c3c;
    margin-left: 1rem;
    opacity: 1;
    animation: none;
}

.dossier-timeline .timeline-item:last-child {
    border-left-color: #e74c3c;
    padding-bottom: 0;
}

.dossier-timeline .timeline-dot {
    position: absolute;
    left: -1.15rem;
    top: 1.8rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dossier-timeline .timeline-dot i {
    width: 14px;
    height: 14px;
    color: white;
}

/* Couleurs par type */
.dossier-timeline .timeline-dot.dot-prise-charge { background: #e74c3c; }
.dossier-timeline .timeline-dot.dot-consultation-hopital { background: #e74c3c; }
.dossier-timeline .timeline-dot.dot-consultation-domicile { background: #e67e22; }
.dossier-timeline .timeline-dot.dot-prise-sang { background: #9b59b6; }
.dossier-timeline .timeline-dot.dot-don-sang { background: #e74c3c; }
.dossier-timeline .timeline-dot.dot-transfusion { background: #3498db; }
.dossier-timeline .timeline-dot.dot-prescription { background: #2ecc71; }
.dossier-timeline .timeline-dot.dot-operation { background: #e74c3c; }
.dossier-timeline .timeline-dot.dot-certificat { background: #8e44ad; }
.dossier-timeline .timeline-dot.dot-deces { background: #2c3e50; }
.dossier-timeline .timeline-dot.dot-default { background: #e74c3c; }

.dossier-timeline .timeline-date {
    display: inline-block;
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: white;
    padding: 0.3rem 0.85rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.35);
}

.dossier-timeline .timeline-content {
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dossier-timeline .timeline-content:hover {
    border-color: rgba(231, 76, 60, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.dossier-timeline .timeline-content-body {
    padding: 1rem 1.15rem;
}

.dossier-timeline .timeline-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #e74c3c;
    font-size: 1rem;
}

.dossier-timeline .timeline-details {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.dossier-timeline .timeline-meta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-style: italic;
}

.dossier-timeline .timeline-action-btn {
    margin-top: 0.75rem;
    padding: 0.45rem 0.9rem;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.dossier-timeline .timeline-action-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(231, 76, 60, 0.3);
}

.dossier-timeline .timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    padding: 0;
    border-bottom: none;
}

.dossier-timeline .timeline-header .timeline-title {
    flex: 1;
}

.dossier-timeline .timeline-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
}

.dossier-timeline .timeline-item:hover .timeline-delete-btn {
    opacity: 1;
}

.dossier-timeline .timeline-delete-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.dossier-timeline .timeline-delete-btn i {
    width: 16px;
    height: 16px;
}

.timeline-details .sams-signature-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 8px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.timeline-header .timeline-title {
    flex: 1;
}

.timeline-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0;
}

.timeline-item:hover .timeline-delete-btn {
    opacity: 1;
}

.timeline-delete-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.timeline-delete-btn i {
    width: 16px;
    height: 16px;
}

/* Mini mannequin dans la timeline */
.timeline-mannequin {
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 1rem;
}

.mini-mannequin {
    position: relative;
    width: 60px;
    height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 5px;
}

.mini-mannequin svg {
    width: 100%;
    height: 100%;
}

.mini-injury-marker {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #e74c3c;
    border: 1px solid white;
    border-radius: 50%;
    color: white;
    font-size: 8px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.timeline-meta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.timeline-action-btn {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-action-btn:hover {
    background: #4752C4;
}

/* Bouton Mettre Ã  jour rÃ©duit */
.btn-update-dossier {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    margin-top: 1rem;
    width: auto;
}

/* Info crÃ©ateur du dossier */
.dossier-creator-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dossier-creator-info strong {
    color: var(--primary);
}

.dossier-creator-info .creator-date {
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Section bouton ajout Ã©lÃ©ment */
.dossier-add-element-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.1) 0%, rgba(88, 101, 242, 0.05) 100%);
    border: 1px dashed var(--primary);
    border-radius: 12px;
    text-align: center;
}

.btn-add-element {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-element:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.btn-add-element i {
    width: 20px;
    height: 20px;
}

#add-element-modal > .modal-content {
    width: min(96vw, 1180px);
    max-width: min(96vw, 1180px);
    border-radius: 16px;
    overflow: hidden;
}

#add-element-modal > .modal-content > .modal-body {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Mannequin corporel pour blessures */
.body-mannequin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.body-mannequin-container h5 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.body-mannequin {
    position: relative;
    width: 200px;
    height: 400px;
    background: var(--bg-light);
    border-radius: 8px;
    cursor: crosshair;
}

.body-mannequin svg {
    width: 100%;
    height: 100%;
}

.body-mannequin .injury-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border: 2px solid #c0392b;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    font-weight: bold;
    z-index: 10;
    animation: pulse-injury 1.5s ease-in-out infinite;
}

@keyframes pulse-injury {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
}

.injury-legend {
    margin-top: 1rem;
    width: 100%;
}

.injury-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.injury-legend-item .injury-number {
    width: 24px;
    height: 24px;
    background: #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
}

.injury-legend-item .remove-injury {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
}

/* Templates prÃ©-remplis */
.template-selector {
    margin-bottom: 1rem;
}

.template-selector label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.template-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.template-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.template-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.template-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

