/* Expert Dashboard Styles */
.expert-dashboard {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    background: #f8f9fa;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-header h1 {
    color: #2c3e50;
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.dashboard-header h1 i {
    color: #3498db;
    margin-right: 10px;
}

.expert-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border: 2px solid #3498db;
    border-radius: 8px;
    text-decoration: none;
    color: #3498db;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary-dark);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-dark);
    color: var(--primary-dark);
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-icon {
    padding: 10px;
    border: none;
    background: transparent;
    color: #7f8c8d;
    cursor: pointer;
}

.btn-icon:hover {
    color: #3498db;
    background: transparent;
    transform: none;
}

/* Expert Interface Layout */
.expert-interface {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    height: calc(100vh - 200px);
}

/* Client List Styles */
.client-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.client-list h3 {
    padding: 20px;
    margin: 0;
    background: #2c3e50;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.client-search {
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
}

.client-search input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #bdc3c7;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.client-search input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.client-items {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
}

.client-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.client-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.client-item.active {
    background: #e3f2fd;
    border-left: 4px solid #3498db;
}

.client-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-size: 20px;
}

.client-info {
    flex: 1;
}

.client-info strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 16px;
}

.client-status {
    font-size: 12px;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
}

.client-status .online {
    color: #27ae60;
    font-size: 8px;
}

.client-status .offline {
    color: #bdc3c7;
    font-size: 8px;
}

.last-activity {
    font-size: 11px;
    color: #95a5a6;
}

.unread-indicator {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Expert Chat Widget */
.expert-chat-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.current-client {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.current-client i {
    color: #3498db;
    font-size: 18px;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
    max-height: calc(100vh - 400px);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.empty-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #bdc3c7;
    text-align: center;
}

.empty-chat i {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-chat p {
    font-size: 16px;
    margin: 0;
}

/* Message Styles */
.message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    position: relative;
}

.message.sent {
    align-self: flex-end;
    background: #3498db;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: white;
    color: #2c3e50;
    border: 1px solid #ecf0f1;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

/* Chat Input */
.chat-input-container {
    padding: 20px;
    border-top: 1px solid #ecf0f1;
    background: white;
    border-radius: 0 0 12px 12px;
}

.message-input-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.message-input-group textarea {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #bdc3c7;
    border-radius: 8px;
    resize: none;
    font-size: 14px;
    font-family: inherit;
    min-height: 50px;
    max-height: 120px;
    transition: border-color 0.3s ease;
}

.message-input-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.message-input-group textarea:disabled {
    background: #ecf0f1;
    cursor: not-allowed;
}

.input-actions {
    display: flex;
    gap: 5px;
}

/* Scrollbar Styling */
.client-items::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.client-items::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.client-items::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 3px;
}

.client-items::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Fichiers joints*/

.attachment-container {
    position: relative;
    z-index: 1;
    pointer-events: auto; /* S'assurer que c'est activé */
}

.download-btn {
    position: relative;
    z-index: 2;
    pointer-events: auto;
    cursor: pointer;
    text-decoration: none; /* Supprimer le soulignement */
    display: inline-flex; /* Pour un bon alignement */
    align-items: center;
    gap: 8px;
}

/* S'assurer qu'aucun élément parent ne bloque les clics */
.message .attachment-container * {
    pointer-events: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .expert-interface {
        grid-template-columns: 300px 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .expert-interface {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .client-list {
        max-height: 300px;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .expert-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .expert-dashboard {
        padding: 10px;
    }

    .dashboard-header {
        padding: 15px;
    }

    .dashboard-header h1 {
        font-size: 24px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .client-item {
        padding: 12px 15px;
    }

    .chat-header {
        padding: 15px;
    }

    .chat-messages {
        padding: 15px;
    }
}

/* Animation for new messages */
@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: messageSlide 0.3s ease;
}

/* Unread indicator animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.unread-indicator {
    animation: pulse 2s infinite;
}

/* Status indicators */
.status-online {
    color: #27ae60;
}

.status-offline {
    color: #bdc3c7;
}

.status-busy {
    color: #e74c3c;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== DASHBOARD EXPERT (edash) ===== */


/* ===== DASHBOARD EXPERT (edash) ===== */
:root {
    --ink:      #0f1117;
    --ink-soft: #3d4151;
    --cream:    #f7f5f0;
    --white:    #ffffff;
    --accent:   #1a56db;
    --green:    #16a34a;
    --orange:   #d97706;
    --red:      #dc2626;
    --border:   #e2ddd6;
    --radius:   12px;
}
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
body { font-family:'DM Sans','Segoe UI',sans-serif; background:var(--cream); color:var(--ink); }
h1,h2,h3,h4 { font-family:'Syne',sans-serif; font-weight:700; }

.edash { display:grid; grid-template-columns:260px 1fr; min-height:100vh; }

.edash__sidebar {
    background:var(--white); border-right:1px solid var(--border);
    padding:2rem 1rem; display:flex; flex-direction:column; gap:2rem;
    position:sticky; top:0; height:100vh; overflow-y:auto;
}
.edash__sidebar-top { display:flex; align-items:center; gap:.75rem; padding:.5rem; }
.edash__avatar {
    width:44px; height:44px; border-radius:12px;
    background:var(--accent); color:#fff;
    display:flex; align-items:center; justify-content:center;
    font-family:'Syne',sans-serif; font-size:1.1rem; font-weight:800; flex-shrink:0;
}
.edash__sidebar-name { font-family:'Syne',sans-serif; font-weight:700; font-size:.95rem; }
.edash__sidebar-role { font-size:.78rem; color:var(--ink-soft); display:flex; align-items:center; gap:.35rem; margin-top:.1rem; }

.edash__nav { display:flex; flex-direction:column; gap:.25rem; }
.edash__nav-item {
    display:flex; align-items:center; gap:.75rem; padding:.7rem 1rem;
    border-radius:8px; color:var(--ink-soft); text-decoration:none;
    font-size:.88rem; transition:background .15s, color .15s;
}
.edash__nav-item:hover { background:var(--cream); color:var(--ink); }
.edash__nav-item--active { background:#dbeafe; color:var(--accent); font-weight:600; }
.edash__nav-item i { width:18px; text-align:center; font-size:.9rem; }

.edash__sidebar-stats {
    margin-top:auto; background:var(--cream); border-radius:var(--radius); padding:1rem;
    display:grid; grid-template-columns:repeat(2,1fr); gap:.5rem; text-align:center;
}
.edash__mini-stat { display:flex; flex-direction:column; gap:.2rem; }
.edash__mini-num { font-family:'Syne',sans-serif; font-size:1.1rem; font-weight:800; color:var(--accent); }
.edash__mini-lbl { font-size:.68rem; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.06em; }

.edash__main { padding:2rem; background:var(--cream); min-height:100vh; }
.edash__header {
    display:flex; justify-content:space-between; align-items:flex-start;
    margin-bottom:2rem; flex-wrap:wrap; gap:1rem;
}
.edash__eyebrow {
    display:inline-block; font-family:'Syne',sans-serif;
    font-size:.72rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
    color:var(--accent); margin-bottom:.4rem;
}
.edash__title { font-size:clamp(1.4rem,3vw,1.8rem); font-weight:800; }
.edash__refresh-btn {
    padding:.5rem 1rem; border-radius:99px;
    border:1.5px solid var(--border); background:var(--white);
    color:var(--ink-soft); font-family:'Syne',sans-serif;
    font-size:.82rem; font-weight:600; cursor:pointer;
    display:flex; align-items:center; gap:.4rem;
    transition:border-color .2s, color .2s;
}
.edash__refresh-btn:hover { border-color:var(--accent); color:var(--accent); }

.edash__stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:1rem; margin-bottom:2rem; }
.edash__stat {
    background:var(--white); border:1px solid var(--border); border-radius:var(--radius);
    padding:1.25rem 1.5rem; display:flex; align-items:center; gap:1rem; transition:transform .2s;
}
.edash__stat:hover { transform:translateY(-2px); }
.edash__stat-icon { width:44px; height:44px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:1.1rem; flex-shrink:0; }
.edash__stat--blue  .edash__stat-icon { background:#dbeafe; color:var(--accent); }
.edash__stat--green .edash__stat-icon { background:#dcfce7; color:var(--green); }
.edash__stat--gold  .edash__stat-icon { background:#fef3c7; color:var(--orange); }
.edash__stat-num { display:block; font-family:'Syne',sans-serif; font-size:1.6rem; font-weight:800; line-height:1; }
.edash__stat-lbl { font-size:.78rem; color:var(--ink-soft); }

.edash__section { background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:1.75rem; }
.edash__section-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:1.5rem; flex-wrap:wrap; gap:1rem; }
.edash__section-title { font-size:1.05rem; display:flex; align-items:center; gap:.5rem; }
.edash__section-title i { color:var(--accent); }

.edash__search { position:relative; min-width:220px; display:flex; align-items:center; }
.edash__search i { position:absolute; left:.75rem; color:var(--ink-soft); font-size:.85rem; pointer-events:none; }
.edash__search input {
    width:100%; padding:.55rem .75rem .55rem 2.2rem;
    border:1.5px solid var(--border); border-radius:99px;
    font-family:'DM Sans',sans-serif; font-size:.85rem;
    background:var(--cream); color:var(--ink); outline:none; transition:border-color .2s;
}
.edash__search input:focus { border-color:var(--accent); }

.eclient-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:1.25rem; }
.eclient { border:1px solid var(--border); border-radius:var(--radius); padding:1.5rem; transition:transform .25s, box-shadow .25s, border-color .25s; }
.eclient:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(15,17,23,.1); border-color:var(--accent); }
.eclient__head { display:flex; align-items:center; gap:.75rem; margin-bottom:1rem; }
.eclient__avatar {
    width:44px; height:44px; border-radius:12px; background:var(--accent); color:#fff;
    display:flex; align-items:center; justify-content:center;
    font-family:'Syne',sans-serif; font-size:1.1rem; font-weight:800; flex-shrink:0;
}
.eclient__info { flex:1; }
.eclient__name { display:block; font-family:'Syne',sans-serif; font-weight:700; font-size:.95rem; }
.eclient__status { display:inline-flex; align-items:center; gap:.35rem; font-size:.78rem; color:var(--ink-soft); margin-top:.2rem; }
.eclient__dot { width:7px; height:7px; border-radius:50%; background:var(--ink-soft); }
.eclient__status--active .eclient__dot { background:var(--green); }
.eclient__status--active { color:var(--green); }
.eclient__unread { background:var(--accent); color:#fff; border-radius:50%; width:24px; height:24px; display:flex; align-items:center; justify-content:center; font-size:.75rem; font-weight:700; flex-shrink:0; }
.eclient__meta { display:flex; flex-direction:column; gap:.35rem; font-size:.82rem; color:var(--ink-soft); margin-bottom:1rem; }
.eclient__meta span { display:flex; align-items:center; gap:.4rem; }
.eclient__meta i { color:var(--accent); width:14px; }
.eclient__actions { display:flex; gap:.5rem; flex-wrap:wrap; }
.ecbtn {
    flex:1; padding:.5rem .75rem; border-radius:8px;
    font-family:'Syne',sans-serif; font-size:.8rem; font-weight:700;
    border:1.5px solid transparent; cursor:pointer;
    display:inline-flex; align-items:center; justify-content:center; gap:.35rem;
    transition:all .2s;
}
.ecbtn--outline { background:var(--white); border-color:var(--border); color:var(--ink-soft); }
.ecbtn--outline:hover { border-color:var(--accent); color:var(--accent); }
.ecbtn--primary { background:var(--accent); color:#fff; }
.ecbtn--primary:hover { filter:brightness(1.1); }
.ecbtn--deliver { background:#f0fdf4; color:var(--green); border-color:var(--green); flex:1; }
.ecbtn--deliver:hover { background:var(--green); color:#fff; }
.eclient-empty { grid-column:1/-1; text-align:center; padding:4rem 2rem; color:var(--ink-soft); }
.eclient-empty i { font-size:3rem; color:var(--border); margin-bottom:1rem; display:block; }
.eclient-empty h4 { font-size:1.1rem; color:var(--ink); margin-bottom:.5rem; }
.eclient-empty p { font-size:.9rem; }

/* Modal */
.zmodal { display:none; position:fixed; inset:0; background:rgba(15,17,23,.55); backdrop-filter:blur(4px); z-index:500; align-items:center; justify-content:center; padding:1rem; }
.zmodal__box { background:var(--white); border-radius:var(--radius); padding:2rem; max-width:480px; width:100%; position:relative; box-shadow:0 24px 60px rgba(15,17,23,.2); animation:modalIn .25s ease; max-height:85vh; overflow-y:auto; }
@keyframes modalIn { from{opacity:0;transform:translateY(16px);}to{opacity:1;transform:none;} }
.zmodal__close { position:absolute; top:1rem; right:1rem; background:var(--cream); border:1px solid var(--border); border-radius:50%; width:32px; height:32px; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:.85rem; color:var(--ink-soft); transition:background .2s; }
.zmodal__close:hover { background:#fee2e2; color:var(--red); }
.zmodal__box h3 { font-size:1.1rem; margin-bottom:1.25rem; }
.client-detail { padding:.75rem 0; border-bottom:1px solid var(--border); font-size:.9rem; }
.client-detail:last-child { border:none; }
.client-detail strong { color:var(--ink); display:inline-block; min-width:160px; font-family:'Syne',sans-serif; }

/* Portefeuille */
.wlabel { font-size:.83rem; font-weight:600; display:block; margin-bottom:.35rem; color:var(--ink); }
.form-group-w { display:flex; flex-direction:column; }
.wop-btn { flex:1; display:flex; align-items:center; justify-content:center; padding:.6rem .5rem; border:1.5px solid var(--border); border-radius:8px; cursor:pointer; font-size:.82rem; font-weight:600; transition:all .2s; user-select:none; }
.wop-btn.selected { border-color:var(--accent); background:#eff6ff; color:var(--accent); }
.wop-btn:hover { border-color:#93c5fd; }
.wquick-btn { padding:.3rem .75rem; border:1px solid var(--border); border-radius:6px; background:var(--cream); font-size:.78rem; cursor:pointer; transition:all .15s; }
.wquick-btn:hover { background:var(--accent); color:#fff; border-color:var(--accent); }
.retrait-item { display:flex; justify-content:space-between; align-items:center; padding:.75rem 1rem; border-radius:8px; border:1px solid var(--border); background:var(--cream); font-size:.85rem; }
.retrait-badge { padding:.2rem .6rem; border-radius:99px; font-size:.72rem; font-weight:700; }
.retrait-badge--pending  { background:#fef3c7; color:#92400e; }
.retrait-badge--approved { background:#d1fae5; color:#065f46; }
.retrait-badge--rejected { background:#fee2e2; color:#991b1b; }

/* Guide rapide */
.guide-card {
    border:1px solid var(--border); border-radius:var(--radius); padding:1.25rem;
    cursor:pointer; transition:all .2s; position:relative;
    display:flex; flex-direction:column; gap:.4rem;
}
.guide-card:hover { border-color:var(--accent); transform:translateY(-2px); box-shadow:0 4px 16px rgba(15,17,23,.07); }
.guide-card__icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:1rem; margin-bottom:.4rem; }
.guide-card strong { font-family:'Syne',sans-serif; font-size:.9rem; color:var(--ink); }
.guide-card p { font-size:.78rem; color:var(--ink-soft); }
.guide-card__chevron { position:absolute; top:1rem; right:1rem; color:var(--ink-soft); font-size:.8rem; transition:transform .2s; }
.guide-detail {
    background:#f8fafc; border:1px solid var(--border); border-radius:var(--radius);
    padding:1.25rem 1.5rem; margin-top:1rem;
    animation:fadeIn .2s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(-6px);}to{opacity:1;transform:none;} }
.guide-steps { padding-left:1.25rem; display:flex; flex-direction:column; gap:.6rem; }
.guide-steps li { font-size:.88rem; line-height:1.6; color:var(--ink-soft); }
.guide-steps li strong { color:var(--ink); }

/* File drop zone */
.file-drop-zone {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:.4rem; padding:1rem; border:2px dashed var(--border); border-radius:var(--radius);
    cursor:pointer; transition:all .2s; text-align:center; font-size:.85rem; color:var(--ink-soft);
}
.file-drop-zone:hover { border-color:var(--accent); background:#f0f7ff; }

/* Tickets historique */
.ticket-item {
    border:1px solid var(--border); border-radius:var(--radius); padding:1rem;
    display:flex; flex-direction:column; gap:.4rem; font-size:.85rem;
}
.ticket-badge { display:inline-flex; align-items:center; padding:2px 10px; border-radius:99px; font-size:.72rem; font-weight:700; }
.ticket-badge--open       { background:#dbeafe; color:#1d4ed8; }
.ticket-badge--in_progress{ background:#fef3c7; color:#92400e; }
.ticket-badge--closed     { background:#d1fae5; color:#065f46; }

@media(max-width:1024px){ .edash { grid-template-columns:1fr; } .edash__sidebar { display:none; } }
@media(max-width:768px){ .edash__main { padding:1.25rem; } .eclient-grid { grid-template-columns:1fr; } .edash__section-head { flex-direction:column; align-items:stretch; } }