/* === Styles généraux === */
.hamburger {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* Sidebar drawer */
.sidebar-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 70%;
    height: 100%;
    background: #fff;
    transition: left 0.3s ease;
    z-index: 1000;
    padding-top: 16px;
}

.sidebar-drawer.active {
    left: 0;
}

.sidebar-drawer-logo {
    padding: 8px 16px;
    text-align: center;
}

.sidebar-drawer-logo img {
    width: 120px;
    height: auto;
}

.sidebar-drawer .nav-section-title {
    color: #2D3748;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 16px;
    border-top: 1px solid #E2E8F0;
    margin-top: 10px;
}

.sidebar-drawer .nav-item.active {
    font-weight: 700;
}

/* Style pour le lien de déconnexion dans le drawer */
.logout-link {
    color: #2E71F3;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 10px 16px;
    border-top: 1px solid #E2E8F0;
    margin-top: auto;
    display: block;
}

/* === Responsive : Mobile et Tablettes (max-width: 100) === */
@media (max-width: 1200px) {
    body {
        font-family: 'Helvetica Neue', sans-serif;
        background: linear-gradient(to top right, #e0eeff 0%, rgba(255, 255, 255, 0.9) 50%, #ffffff 100%);
        background-size: 100% 100%;
        background-attachment: fixed;
        color: #333;
        margin: 0;
    }

    .container {
        margin-left: 40px;
    }

    .hamburger {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 1001;
    }

    .sidebar {
        display: none;
    }

    .sidebar-drawer {
        display: block;
    }

    .user-info {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 1001;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .user-info img {
        width: 24px;
        height: 24px;
    }

    .user-name,
    .user-email {
        font-size: 12px;
    }

    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .btn-create-company {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        text-align: center;
        border-radius: 24px;
        width: auto;
    }

    .btn-primary-custom i,
    .btn-create-company i {
        margin: 0;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .page-header .d-flex {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }

    .btn-create-company,
    .btn-back2 {
        margin-bottom: 8px;
        text-align: center;
        padding: 10px;
    }

    .row.g-4 {
        margin-top: 16px;
    }

    .col-md-3,
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .status-card,
    .dashboard-card-inner {
        padding: 16px;
    }

    .dashboard-card {
        min-height: auto;
    }

    .btn-primary-custom {
        padding: 8px 16px;
        background: #2E71F3;
        border-radius: 24px;
        /* Bordures plus arrondies */
        color: white;
        font-size: 16px;
        font-weight: 500;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 10px;
        transition: background 0.2s;
        border: none;
        outline: none;
        width: auto;
    }

    .btn-disabled-custom {
        width: 100%;
    }

    .page-title {
        font-size: 20px;
    }

    .page-subtitle {
        font-size: 14px;
    }

    .status-label {
        font-size: 12px;
    }

    .status-count {
        font-size: 16px;
    }

    .drawer,
    .drawer-compagnie {
        width: 90%;
        right: -90%;
        transition: right 0.3s ease-in-out;
    }

    .drawer.active,
    .drawer-compagnie.active {
        right: 0;
    }

    .drawer-footer,
    .drawer-footer2 {
        width: 90%;
        padding: 16px;
    }

    .drawer-body {
        padding: 16px;
        padding-bottom: 80px;
    }

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

    .formalites-list,
    .contacts-list {
        max-height: 250px;
    }

    .contacts-form {
        max-height: 350px;
    }

    .btn-add-contact {
        margin-top: 16px;
    }

    .alert-info {
        font-size: 12px;
    }

    .alert-title {
        font-size: 14px;
    }

    .contact-compact {
        padding: 8px;
    }

    .contact-name,
    .contact-role,
    .contact-email,
    .contact-phone {
        font-size: 12px;
    }

    .cta-section img {
        width: 100%;
        height: auto;
    }

    .footer {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 20px;
        text-align: center;
        font-size: 14px;
    }

    .footer div {
        margin-bottom: 10px;
    }
}

/* Mobile : Petits écrans (max-width: 767px) */
@media (max-width: 767px) {
    .login-container {
        padding: 2% 5%;
    }

    .login-card .left-section-show,
    .login-card .background-image {
        display: none;
    }

    .login-form h1 {
        font-size: 18px;
    }

    .form-control2 {
        padding: 16px;
        font-size: 15px;
        height: 50px;
        border-radius: 12px;
    }

    .btn-primary2,
    .btn-google,
    .btn-secondary {
        padding: 14px;
        font-size: 15px;
        height: 50px;
    }

    .name-row {
        flex-direction: column;
        gap: 8px;
    }

    .formalites-list {
        max-height: 50vh;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #E2E8F0;
        padding: 8px;
        background: #fff;
    }

    .formalites-list::-webkit-scrollbar {
        width: 10px;
    }

    .formalites-list::-webkit-scrollbar-thumb {
        background: #718096;
        border-radius: 5px;
    }

    .formalites-list::-webkit-scrollbar-track {
        background: #EDF2F7;
    }

    .formalite-item {
        font-size: 14px;
    }

    .step-2-scrollable {
        max-height: 40vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .btn-add-contact {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 10px;
        border-top: 1px solid #E2E8F0;
        width: 100%;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .drawer-footer {
        position: fixed;
        bottom: 0;
        width: 100%;
        background: white;
        padding: 16px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    .form-label {
        font-size: 12px;
    }

    .form-control {
        font-size: 14px;
        padding: 8px;
    }

    .drawer-title {
        font-size: 16px;
    }

    .drawer-subtitle {
        font-size: 12px;
    }
}

/* Tablettes (min-width: 768px et max-width: 1200px) */
@media (min-width: 768px) and (max-width: 1200px) {

    .sidebar-drawer .nav-item,
    .sidebar-drawer .logout-link {
        font-size: 16px;
        padding: 12px 16px;
    }

    .sidebar-drawer-logo img {
        width: 140px;
    }

    .sidebar-drawer .nav-section-title {
        font-size: 14px;
    }

    .page-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
    }

    .page-header>div:first-child {
        text-align: left;
    }

    .page-header .d-flex {
        flex-direction: column;
        width: auto;
        gap: 8px;
    }

    .btn-create-company {
        font-size: 14px;
        padding: 8px 12px;
        min-width: 180px;
        width: auto;
    }

    .btn-back2 {
        width: auto;
        min-width: 180px;
        padding: 8px 12px;
    }

    .page-breadcrumb {
        font-size: 18px;
    }

    .page-title {
        font-size: 26px;
    }

    .page-subtitle {
        font-size: 20px;
    }

    .status-label {
        font-size: 14px;
    }

    .status-count {
        font-size: 18px;
    }

    .dashboard-card {
        padding: 20px;
    }

    .dashboard-card-inner {
        padding: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .dashboard-card-inner .btn-primary-custom {
        width: auto;
        min-width: 120px;
    }

    .formalites-list,
    .contacts-list {
        max-height: 400px;
    }

    .form-control,
    .form-select {
        font-size: 16px;
        padding: 12px 16px;
    }

    .alert-info,
    .contact-name,
    .contact-role,
    .contact-email,
    .contact-phone {
        font-size: 14px;
    }

    .status-card {
        height: 100px;
        display: flex;
        align-items: center;
        width: 100%;
    }

    .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* ✅ Hover effect limité à tablette */
    .nav-item:hover::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: #F4F7FB;
        box-shadow: 0px 5px 20px rgba(59, 64, 86, 0.03);
        border-radius: 16px;
        z-index: -1;
    }

    /* ✅ Active effect limité à tablette */
    .nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: #EBEFF6;
        box-shadow: 0px 5px 20px rgba(59, 64, 86, 0.05);
        border-radius: 16px;
        z-index: -1;
    }
}

/* Desktop : Tous les écrans larges (min-width: 1201px) */
@media (min-width: 1201px) {

    .sidebar-drawer,
    .hamburger,
    .logout-link {
        display: none;
    }

    .sidebar {
        width: 255px;
        height: 100vh;
        padding-top: 16px;
    }

    .sidebar-logo img {
        width: 200px;
    }

    .sidebar-logo::after {
        margin-top: 25px;
    }

    .sidebar-nav {
        gap: 16px;
        margin-top: -25px;
    }

    .nav-item {
        font-size: 12px;
        padding: 12px 16px;
    }

    .nav-section-title {
        font-size: 12px;
        padding: 0 24px;
    }

    .sidebar-footer {
        padding: 8px;
    }

    .user-info img {
        width: 32px;
        height: 32px;
    }

    .user-name {
        font-size: 14px;
    }

    .user-email {
        font-size: 12px;
    }
}

/* Desktop : Hauteur moyenne à basse (<=900px) */
@media (min-width: 1201px) and (max-height: 900px) {
    .sidebar-content {
        gap: 12px;
        padding-bottom: 12px;
    }

    .sidebar-logo {
        margin-top: 8px;
    }

    .sidebar-logo img {
        width: 160px;
    }

    .sidebar-logo::after {
        margin-top: 12px;
    }

    .sidebar-nav {
        gap: 8px;
        margin-top: -12px;
    }

    .nav-item {
        font-size: 11px;
        padding: 8px 12px;
    }

    .nav-section-title {
        font-size: 11px;
        padding: 0 16px;
    }

    .sidebar-footer {
        padding: 6px;
    }

    .user-info img {
        width: 26px;
        height: 26px;
    }

    .user-name {
        font-size: 13px;
    }

    .user-email {
        font-size: 11px;
    }

    .help-section {
        padding: 8px 0;
    }
}

/* Desktop : Hauteur très basse (<600px) */
@media (min-width: 1201px) and (max-height: 600px) {
    .sidebar-content {
        overflow-y: auto;
        gap: 8px;
        padding-bottom: 8px;
    }

    .sidebar-logo {
        margin-top: 4px;
    }

    .sidebar-logo img {
        width: 120px;
    }

    .sidebar-logo::after {
        margin-top: 6px;
    }

    .sidebar-nav {
        gap: 4px;
        margin-top: -6px;
    }

    .nav-item {
        font-size: 10px;
        padding: 6px 10px;
    }

    .nav-section-title {
        font-size: 10px;
        padding: 0 10px;
    }

    .sidebar-footer {
        padding: 4px;
    }

    .user-info img {
        width: 20px;
        height: 20px;
    }

    .user-name {
        font-size: 12px;
    }

    .user-email {
        font-size: 10px;
    }

    .help-section {
        padding: 4px 0;
    }
}

/* Styles généraux */
#contacts-list {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

#contacts-list::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

#chat-messages::-webkit-scrollbar {
    width: 8px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #A0AEC0;
    border-radius: 4px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #E2E8F0;
}

#dropzone.drag-over {
    background-color: #e6f0ff;
    outline: 2px dashed #2E71F3;
}

.filter-button {
    cursor: pointer;
}

.filter-button:hover {
    background: #e6f0ff;
}

/* Desktop styles (from inline CSS) */
.content-wrapper {
    margin-left: 5px;
    padding: 16px 16px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    font-family: Arial, sans-serif;
    width: 100%;
    box-sizing: border-box;
    min-height: calc(100vh - 82px);
}

.page-header {
    align-self: stretch;
    justify-content: space-between;
    align-items: flex-end;
    display: flex;
}

.page-header>div:first-child {
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
    display: inline-flex;
}

.page-header>div:last-child {
    display: flex;
    gap: 16px;
    align-items: center;
}

.main-content {
    display: flex;
    gap: 24px;
    flex: 1;
}

.left-section-show {
    width: 66%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.chat-section {
    width: 40%;
    padding: 24px;
    background: white;
    box-shadow: 0px 20px 40px rgba(59, 64, 86, 0.05);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - 300px);
    overflow: hidden;
}

.top-row {
    display: flex;
    gap: 24px;
    align-items: stretch;
}

.details-section {
    width: 55%;
    padding: 24px;
    background: white;
    box-shadow: 0px 20px 40px rgba(59, 64, 86, 0.05);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contacts-section {
    width: 40%;
    padding: 24px;
    background: white;
    box-shadow: 0px 20px 40px rgba(59, 64, 86, 0.05);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    overflow: hidden;
}

.documents-section {
    align-self: stretch;
    padding: 24px;
    background: white;
    box-shadow: 0px 20px 40px rgba(59, 64, 86, 0.05);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.details-section>div:first-child,
.contacts-section>div:first-child>div:first-child,
.documents-section>div:first-child>div:first-child,
.chat-section>div:first-child {
    flex-direction: column;
    display: flex;
}

.details-section>div:first-child>div:first-child,
.contacts-section>div:first-child>div:first-child>div:first-child,
.documents-section>div:first-child>div:first-child>div:first-child,
.chat-section>div:first-child>div:first-child {
    color: #09090B;
    font-size: 24px;
    font-weight: 700;
}

.details-section>div:first-child>div:last-child,
.contacts-section>div:first-child>div:first-child>div:last-child,
.documents-section>div:first-child>div:first-child>div:last-child,
.chat-section>div:first-child>div:last-child {
    padding-top: 4px;
    color: #A7A7A7;
    font-size: 14px;
    font-weight: 400;
}

.details-info {
    align-self: stretch;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.70);
    border-radius: 16px;
    outline: 1px #E2E8F0 solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.details-info>div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.details-info>div:first-child>div:first-child {
    color: #8B8B9C;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
}

.details-info>div:first-child>div:nth-child(2) {
    color: #2D3748;
    font-size: 14px;
    font-weight: 700;
    line-height: 19.6px;
}

.details-info>div:first-child>div:last-child {
    color: #2D3748;
    font-size: 12px;
    font-weight: 400;
    line-height: 16.8px;
}

.details-info>div:last-child {
    color: #2E71F3;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: right;
}

.details-company-email {
    align-self: stretch;
    display: flex;
    gap: 10px;
}

.details-company-email>div {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.70);
    border-radius: 16px;
    outline: 1px #E2E8F0 solid;
}

.details-company-email>div>div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.details-company-email>div>div>div:first-child {
    color: #8B8B9C;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
}

.details-company-email>div>div>div:last-child {
    color: #2D3748;
    font-size: 14px;
    font-weight: 700;
    line-height: 19.6px;
}

.contacts-section>div:first-child {
    align-self: stretch;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#contacts-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    /* Active le défilement horizontal si nécessaire */
    scroll-snap-type: x mandatory;
    /* Contrôle le défilement pour "snapper" sur chaque contact */
    padding: 0 24px;
    width: 100%;
    /* Le conteneur prend toute la largeur de la carte */
    box-sizing: border-box;
    /* Inclut le padding dans la largeur */
}

#contacts-list>div {
    flex: 0 0 100%;
    /* Chaque contact occupe 100% de la largeur visible */
    scroll-snap-align: start;
    /* Alignement au début pour un défilement propre */
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.70);
    border-radius: 16px;
    outline: 1px #E2E8F0 solid;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#contacts-prev,
#contacts-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

#contacts-prev {
    left: 0;
}

#contacts-next {
    right: 0;
}

#contacts-prev>i,
#contacts-next>i {
    font-size: 12px;
    color: #2D3748;
}

#contacts-dots {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.contact-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    cursor: pointer;
}

.contacts-section>div:last-child:not(:first-child) {
    align-self: stretch;
    outline: 1px #E2E8F0 solid;
    outline-offset: -1px;
    padding: 36px 12px 12px 12px;
    background: rgba(255, 255, 255, 0.70);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-height: 180px;
}

.documents-section>div:first-child {
    align-self: stretch;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.documents-section>div:nth-child(2) {
    align-self: stretch;
    height: 40px;
    padding: 4px;
    background: #F8F9FA;
    border-radius: 16px;
    justify-content: center;
    align-items: center;
    display: inline-flex;
}

.chat-section>div:first-child>hr {
    border: none;
    border-top: 1px solid #CBD5E1;
    margin: 12px 0;
}

.chat-section>div:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#chat-messages {
    flex: 1;
    min-height: 0;
    max-height: 600px;
    overflow-y: auto;
    padding: 16px;
    background: white;
    border-radius: 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.chat-section>div:last-child>div:last-child {
    align-self: stretch;
    padding: 16px 20px;
    background: white;
    border-radius: 15px;
    outline: 1px #E2E8F0 solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

#chat-form {
    display: flex;
    flex: 1;
    gap: 16px;
}

#chat-input {
    flex: 1;
    padding: 16px 20px;
    border-radius: 20px;
    outline: 1px #E2E8F0 solid;
    color: #8B8B9C;
    font-size: 14px;
    font-weight: 400;
    font-family: Arial, sans-serif;
}

/* Documents and dropzone styles */
#documents-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-content: flex-start;
}

.document-item,
#dropzone {
    flex: 1 0 calc((100% - 48px)/3);
    /* 3 items per row, accounting for 24px gap */
    min-width: 235px;
    max-width: calc((100% - 48px)/3);
    min-height: 130px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.70);
    border-radius: 16px;
    outline: 1px #E2E8F0 solid;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    justify-content: center;
    align-items: stretch;
    text-align: center;
}

#dropzone .dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#dropzone:not(:only-child) {
    min-height: 130px;
    flex: 1 0 calc((100% - 48px)/3);
    /* Même largeur que document-item sur desktop */
    max-width: calc((100% - 48px)/3);
    min-width: 235px;
}

#dropzone:only-child {
    flex: 0 0 100%;
    max-width: 100% !important;
    min-width: 100% !important;
    height: auto;
}

.document-item>img.delete-document {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.document-item>div:first-of-type {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.document-item>div:first-of-type>div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.document-item>div:first-of-type>div:first-child>div {
    color: #8B8B9C;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
}

.document-item>div:first-of-type>div:nth-child(2) {
    color: #2E71F3;
    font-size: 14px;
    font-weight: 700;
    line-height: 19.6px;
}

.document-item>div:first-of-type>div:nth-child(2)>img {
    width: 8px;
    height: 8px;
}

.document-item>div:first-of-type>div:last-child {
    color: #2D3748;
    font-size: 12px;
    font-weight: 400;
    line-height: 16.8px;
}

.document-item>hr {
    border: none;
    border-top: 1px solid #CBD5E1;
    margin: 4px 0;
}

.document-item>div:last-child {
    display: flex;
    gap: 16px;
}

.document-item>div:last-child>a {
    flex: 1;
    padding: 4px 8px;
    background: white;
    border-radius: 16px;
    outline: 0.5px #E2E8F0 solid;
    text-align: center;
    color: #2D3748;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    text-decoration: none;
}

#dropzone>div {
    display: flex;
    flex-direction: column;
    /* Changé pour centrer verticalement */
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#dropzone>div>img {
    width: 16px;
    height: 16px;
}

#dropzone>div>div {
    color: #A7A7A7;
    font-size: 14px;
    font-weight: 400;
}

#dropzone>button {
    padding: 6px 12px;
    width: auto;
    display: inline-flex;
    font-size: 14px;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Tablet styles (768px - 1200px) */
@media (min-width: 768px) and (max-width: 1200px) {
    .content-wrapper {
        padding: 24px;
        margin-left: 0;
    }

    .main-content {
        flex-direction: column;
    }

    .left-section-show,
    .chat-section {
        width: 100%;
        max-width: 100%;
    }

    .top-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .details-section,
    .contacts-section,
    .documents-section,
    .chat-section {
        width: 100%;
        padding: 24px;
        box-sizing: border-box;
    }

    .details-info {
        flex-direction: column;
        align-items: stretch;
    }

    .details-info>div {
        width: 100%;
        text-align: left;
    }

    .details-info>div:last-child {
        text-align: left;
    }

    .details-company-email {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .details-company-email>div {
        flex: 1 0 calc(50% - 5px);
        max-width: calc(50% - 5px);
    }

    #contacts-list {
        flex-direction: row;
        overflow-x: auto;
        padding: 0;
    }

    #contacts-list>div {
        flex: 0 0 calc(50% - 8px);
        max-width: calc(50% - 8px);
    }

    #documents-container {
        flex-wrap: wrap;
    }

    .document-item,
    #dropzone:not(:only-child) {
        flex: 1 0 calc((100% - 24px)/2);
        min-width: calc((100% - 24px)/2);
        max-width: calc((100% - 24px)/2);
    }

    #dropzone:only-child {
        flex: 0 0 100%;
        min-width: 100%;
    }
}

/* Mobile styles (max-width: 767px) */
@media (max-width: 767px) {
    .content-wrapper {
        padding: 10px;
        margin-left: 5px;
    }

    .page-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .page-header>div {
        width: 100%;
    }

    .main-content {
        flex-direction: column;
    }

    .left-section-show,
    .chat-section {
        width: 100%;
        max-width: 100%;
    }

    .top-row {
        flex-direction: column;
    }

    .details-section,
    .contacts-section,
    .documents-section,
    .chat-section {
        width: 100%;
        padding: 16px;
        box-sizing: border-box;
    }

    .details-info {
        flex-direction: column;
        align-items: stretch;
    }

    .details-info>div {
        width: 100%;
        text-align: left;
    }

    .details-info>div:last-child {
        text-align: left;
    }

    .details-company-email {
        flex-direction: column;
    }

    .details-company-email>div {
        flex: 1 0 100%;
        max-width: 100%;
    }

    #contacts-list {
        flex-direction: column;
        overflow-x: visible;
        padding: 0;
    }

    #contacts-list>div {
        flex: 1 0 100%;
        max-width: 100%;
    }

    #contacts-prev,
    #contacts-next {
        display: none;
    }

    #contacts-dots {
        display: none;
    }

    #documents-container {
        flex-direction: column;
    }

    .document-item,
    #dropzone {
        flex: 1 0 100%;
        min-width: 100%;
        max-width: 100%;
    }

    .chat-messages {
        max-height: 300px;
    }

    .page-title {
        font-size: 18px;
        text-align: left;
        /* Force l'alignement à gauche */
    }

    .page-subtitle {
        font-size: 14px;
    }

    .details-section>div:first-child>div:first-child,
    .contacts-section>div:first-child>div:first-child>div:first-child,
    .documents-section>div:first-child>div:first-child>div:first-child,
    .chat-section>div:first-child>div:first-child {
        font-size: 20px;
    }
}

@media (min-width: 1201px) {
    .content-wrapper {
        margin-left: 255px;
        /* Largeur de la sidebar */
        width: calc(100% - 255px);
    }
}

@media (min-width: 1201px) {
    .content-wrapper2 {
        margin-left: 15px;
        /* Largeur de la sidebar */
        width: calc(100% - 15px);
    }
}

/* Chat styles moved to styles.css for better organization */


.chat-message-user .chat-bubble {
    background: #2E71F3;
    color: white;
    border: none;
    align-self: flex-end;
    /* Messages de l’utilisateur à droite */
}

.chat-message-other .chat-bubble {
    align-self: flex-start;
    /* Messages des autres à gauche */
}

.chat-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
    flex-wrap: nowrap;
    width: 100%;
}

.chat-time {
    font-size: 0.8rem;
    /* Remplace small-text */
}

.chat-status-icon {
    display: inline-flex;
    flex-shrink: 0;
}



@media (max-width: 1200px) {
    #contacts-list {
        flex-direction: column;
        overflow-x: visible;
        padding: 0;
    }

    #contacts-list>div {
        width: 100%;
        flex: 1 0 auto;
    }

    #contacts-dots {
        display: flex;
        /* Points bleus visibles dès le début */
    }
}

.contact-dot.active {
    background: #2E71F3;
}

/* Tablettes : entre 768px et 1200px */
@media (min-width: 768px) and (max-width: 1200px) {
    .contacts-section-dossier {
        width: 100% !important;
        padding: 16px !important;
    }

    #contacts-list {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        width: 100% !important;
        padding: 0 16px !important;
    }

    #contacts-list>div {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Mobiles : moins de 767px */
@media (max-width: 767px) {
    .contacts-section-dossier {
        width: 100% !important;
        padding: 12px !important;
    }

    #contacts-list {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        width: 100% !important;
        padding: 0 12px !important;
    }

    #contacts-list>div {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Styles par défaut (desktop) */
.button-container {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    /* Boutons à gauche sur desktop */
}



.btn-primary-custom .button-text {
    display: inline;
    /* Affiche le texte sur desktop */
}

.btn-danger-custom i {
    display: none;
    /* Masque les icônes sur desktop */
}

.btn-danger-custom .button-text {
    display: inline;
    /* Affiche le texte sur desktop */
}

.btn-back i {
    display: none;
    /* Masque les icônes sur desktop */
}

.btn-back .button-text {
    display: inline;
    /* Affiche le texte sur desktop */
}

/* Styles pour mobile (≤ 768px) */
@media (max-width: 768px) {
    .button-container {
        justify-content: flex-end;
        /* Déplace les boutons à droite sur mobile */
        width: 100%;
        /* Prend toute la largeur pour l'alignement */
    }

    .btn-primary-custom {
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .btn-primary-custom i {
        display: block;
        /* Affiche les icônes sur mobile */
        font-size: 18px;
    }

    .btn-primary-custom .button-text {
        display: none;
        /* Masque le texte sur mobile */
    }

    .btn-danger-custom i {
        display: block;
        /* Affiche les icônes sur mobile */
        font-size: 18px;
    }

    .btn-danger-custom .button-text {
        display: none;
        /* Masque le texte sur mobile */
    }

    .btn-back i {
        display: block;
        /* Affiche les icônes sur mobile */
        font-size: 18px;
    }

    .btn-back .button-text {
        display: none;
        /* Masque le texte sur mobile */
    }

    .btn-primary-custom.btn-large-mobile {
        width: auto;
        height: auto;
        padding: 8px 16px;
        border-radius: 24px;
        font-size: 16px;
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }
}

.button-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.badge-wrapper {
    flex: 1;
}

.actions-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Badge */
.badge-status {
    padding: 4px 6px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
}

.badge-status i {
    font-size: 14px;
}

@media (max-width: 767px) {
    .button-group {
        flex-direction: row;
    }

    .badge-wrapper {
        flex: 1;
        order: 1;
    }

    .actions-wrapper {
        flex-shrink: 0;
        order: 2;
        margin-left: auto;
    }

    .drawer-body {
        gap: 8px;
        padding-bottom: 265px;
    }
}

.compagnie-edit-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.compagnie-form-group {
    margin-bottom: 1.5rem;
}

.compagnie-form-input,
.compagnie-form-select {
    width: 100%;
    padding: 8px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.compagnie-label-bold {
    font-weight: 700;
}

.compagnie-btn {
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.compagnie-btn-primary {
    background: #2E71F3;
    color: white;
}

.compagnie-btn-danger {
    background: #dc3545;
    color: white;
}

@media (max-width: 767px) {
    .compagnie-edit-container {
        padding: 10px;
    }

    .compagnie-form-input,
    .compagnie-form-select {
        font-size: 14px;
        padding: 6px;
    }

    .compagnie-btn {
        width: 100%;
        padding: 10px;
        font-size: 14px;
        border-radius: 20px;
    }

    .compagnie-form-group {
        margin-bottom: 1rem;
    }

    .compagnie-edit-container h1,
    .compagnie-edit-container h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 767px) {
    .timeline-wrapper {
        padding-left: 50px;
        /* Réduire le padding pour limiter le décalage */
    }

    .timeline-date {
        left: -50px;
        /* Réduire la position absolue pour garder la date dans la carte */
        width: 50px;
        /* Ajuster la largeur pour correspondre */
    }

    .timeline-date-placeholder {
        left: -50px;
        /* Même ajustement pour le placeholder */
        width: 50px;
    }

    .timeline-item.has-vertical-line::before {
        left: -25px;
        /* Ajuster la position de la ligne verticale (moitié de 50px) */
    }
}