/* 상담·예약 상세 모달 */
.request-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* 사이드바 폼 스타일 */
.sidebar-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.sidebar-form .required {
    color: var(--danger);
    margin-left: 2px;
}

.sidebar-form .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar-form .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.sidebar-form select.form-control {
    cursor: pointer;
}

.sidebar-form textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.sidebar-form .btn-block {
    width: 100%;
    margin-top: 8px;
}

.request-detail-modal .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    cursor: pointer;
}

.request-detail-modal .modal-content {
    position: relative;
    z-index: 10001;
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.request-detail-modal .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.request-detail-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.request-detail-modal .btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.request-detail-modal .btn-close:hover {
    background: var(--gray-200);
}

.request-detail-modal .modal-body {
    padding: 24px;
}

/* 상담 기록 타임라인 */
.consultation-timeline {
    margin-bottom: 16px;
}

.note-item {
    background: var(--gray-50);
    border-left: 3px solid var(--primary);
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.note-author {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 14px;
}

.note-time {
    font-size: 12px;
    color: var(--gray-500);
}

.note-content {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.5;
    white-space: pre-wrap;
}

.add-note-form {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.add-note-form textarea {
    flex: 1;
    resize: vertical;
}

.add-note-form .btn {
    margin-top: 0;
}

/* 첨부파일 */
.attachments-area {
    margin-bottom: 16px;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    transition: all 0.2s;
}

.attachment-item:hover {
    background: var(--gray-100);
    border-color: var(--primary);
}

.attachment-item > i {
    font-size: 24px;
    color: var(--primary);
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-meta {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 2px;
}

.attachment-actions {
    display: flex;
    gap: 4px;
}

.file-upload-form {
    margin-top: 12px;
}

/* 연결된 업무 */
.linked-work-items {
    margin-bottom: 16px;
}

.work-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.work-item-card {
    padding: 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.work-item-card:hover {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.work-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.work-category {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.work-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.work-status.status-todo {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.work-status.status-doing {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.work-status.status-done {
    background: rgba(13, 148, 136, 0.1);
    color: #0D9488;
}

.work-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.work-item-due {
    font-size: 12px;
    color: var(--gray-600);
}

/* 업무 연결 모달 */
.work-link-modal .modal-content {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.work-select-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.work-select-item {
    padding: 12px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.work-select-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}

/* Empty states */
.empty-state-small {
    text-align: center;
    padding: 32px 16px;
    color: var(--gray-500);
}

.empty-state-small i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-small p {
    font-size: 14px;
    margin: 0;
}

/* 반응형 */
@media (max-width: 768px) {
    .request-detail-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .request-detail-modal .modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
        animation: modalSlideUpMobile 0.3s ease;
    }
    
    @keyframes modalSlideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .request-detail-modal .modal-body {
        padding: 16px;
    }
    
    .note-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .attachment-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .attachment-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .add-note-form {
        flex-direction: column;
    }
    
    .add-note-form .btn {
        width: 100%;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
