.agent-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(4, 5, 10, .75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.agent-modal-backdrop.active {
    display: block;
}

.agent-contact-section {
    position: fixed;
    z-index: 99999;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid rgba(245, 194, 66, .32);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012)), rgba(10, 6, 2, .97);
    box-shadow: 0 32px 80px rgba(0, 0, 0, .65), 0 0 0 1px rgba(245, 194, 66, .08) inset;
    transform: translate(-50%, -50%);
    animation: agent-directory-modal-in .25s ease-out;
}

.agent-contact-section.agent-contact-hidden {
    display: none !important;
}

.agent-contact-section .modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.agent-contact-section .modal-avatar {
    position: relative;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    padding: 2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffe9a8, #f5c242 50%, #b97818);
}

.agent-contact-section .modal-avatar-img {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(10, 6, 2, .92);
    border-radius: 50%;
    object-fit: cover;
}

.agent-contact-section .modal-avatar-img.agent-photo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffd24d, #f5a700);
    color: #0a0b10;
    font-weight: 800;
}

.agent-contact-section .modal-avatar-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(10, 6, 2, .95);
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
}

.agent-contact-section .modal-avatar-badge svg {
    width: 10px;
    height: 10px;
}

.agent-contact-section .modal-title-section {
    flex: 1;
    min-width: 0;
}

.agent-contact-section .modal-title {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.agent-contact-section .modal-agent-id {
    display: inline-flex;
    gap: 4px;
    color: #fbbf24;
    font-size: 12px;
}

.agent-contact-section .modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    cursor: pointer;
}

.agent-contact-section .modal-close svg {
    width: 16px;
    height: 16px;
}

.agent-contact-section .contact-column {
    margin: 0;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    background: rgba(255, 255, 255, .025);
}

.agent-contact-section .whatsapp-column {
    border-color: rgba(37, 211, 102, .28);
}

.agent-contact-section .telegram-column {
    border-color: rgba(0, 136, 204, .3);
}

.agent-contact-section .contact-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.agent-contact-section .whatsapp-column .contact-header {
    color: #25d366;
}

.agent-contact-section .telegram-column .contact-header {
    color: #29a9eb;
}

.agent-contact-section .contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .22);
}

.agent-contact-section .contact-number {
    min-width: 0;
    overflow: hidden;
    color: #f1f5f9;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-contact-section .contact-actions {
    display: inline-flex;
    gap: 5px;
    flex-shrink: 0;
}

.agent-contact-section .copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 7px;
    background: rgba(255, 255, 255, .04);
    color: #d1d5db;
    cursor: pointer;
}

.agent-contact-section .copy-btn.copied {
    color: #19c37d;
}

.agent-contact-section .message-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 10px;
    border-radius: 7px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.agent-contact-section .whatsapp-message-btn {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.agent-contact-section .telegram-message-btn {
    background: linear-gradient(135deg, #29a9eb, #0876b9);
}

@keyframes agent-directory-modal-in {
    from { opacity: 0; transform: translate(-50%, -48%) scale(.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (max-width: 480px) {
    .agent-contact-section {
        padding: 14px;
    }
}
